define("zenjs/backbone/quantity", ["require", "backbone"], function (t) {
    var e = t("backbone"), i = function () {
    }, n = e.View.extend({
        template: _.template('<div class="quantity">            <button class="minus" type="button" <% if (data.readonly){ %> disabled <% } %> ></button>            <input type="text" class="txt" value="<%= data.num %>" <% if (data.readonly){ %> readonly <% } %>/>            <button class="plus" type="button" <% if (data.readonly){ %> disabled <% } %>></button>            <div class="response-area response-area-minus"></div>            <div class="response-area response-area-plus"></div>        </div>'),
        initialize: function () {
            var t = function (t, e, i) {
                var n;
                return i > e ? (n = e, 0 !== e && (this.disabled = !0)) : n = i > t ? i : t > e ? e : t, n
            };
            return function (e) {
                this.onNumChange = e.onNumChange || i, this.onOverLimit = e.onOverLimit || i, this.limitNum = parseInt(e.limitNum), this.minimalNum = parseInt(e.minimalNum), this.minimalNum = 0 == this.minimalNum ? 0 : this.minimalNum || 1, this.onBelowLeast = e.onBelowLeast || i, this.disabled = e.disabled, this.num = t.call(this, e.num, this.limitNum, this.minimalNum), this.readonly = e.readonly, this.num != e.num && this.onNumChange(this.num)
            }
        }(),
        events: {"click .response-area-minus": "onSubClicked", "click .response-area-plus": "onAddClicked"},
        onSubClicked: function (t) {
            this.changeNum(this.num - 1)
        },
        onAddClicked: function () {
            this.changeNum(this.num + 1)
        },
        changeNum: function (t) {
            if (!this.readonly && !this.disabled) {
                if (t > this.limitNum)return void this.onOverLimit(t, this.limitNum);
                if (t < this.minimalNum)return this.onBelowLeast(t, this.minimalNum), void(t = this.minimalNum);
                this.updateBtnStatus(t), this.updateNum(t)
            }
        },
        updateBtnStatus: function () {
            var t = function (t) {
                t.addClass("disabled"), t.attr("disabled", "true")
            }, e = function (t) {
                t.removeClass("disabled"), t.removeAttr("disabled")
            };
            return function (i) {
                return this.readonly ? (t(this.nMinus), void t(this.nPlus)) : (i > this.minimalNum ? e(this.nMinus) : t(this.nMinus), void(this.limitNum > 0 && i >= this.limitNum ? t(this.nPlus) : e(this.nPlus)))
            }
        }(),
        updateNum: function (t) {
            this.disabled || (this.num = +t, this.$("input").val(this.num), this.onNumChange(this.num))
        },
        refreshNum: function () {
            var t = parseInt(this.$("input").val());
            this.num !== t && (t > 0 ? this.limitNum > 0 && t > this.limitNum ? this.num = this.limitNum : this.num = t : (this.num = this.minimalNum, this.updateNum(this.num)), this.changeNum(this.num))
        },
        setLimitNum: function (t) {
            this.disabled || 1 > t || (this.limitNum = +t, this.limitNum < this.num && this.changeNum(this.limitNum))
        },
        setMinimalNum: function (t) {
            this.disabled || 1 > t || (this.minimalNum = +t, this.num < this.minimalNum && this.changeNum(this.minimalNum))
        },
        validateNum: function (t) {
            var e = parseInt(this.$("input").val());
            return this.$("input").val(e), e > this.limitNum || 0 === this.limitNum ? (this.onOverLimit(e, this.limitNum), !1) : e < this.minimalNum ? (this.onBelowLeast(e, this.minimalNum), !1) : !0
        },
        getNum: function () {
            return this.validateNum() ? (this.refreshNum(), this.num) : null
        },
        render: function () {
            return this.$el.html(this.template({
                data: {
                    num: this.num,
                    readonly: this.readonly
                }
            })), this.nMinus = this.$(".minus"), this.nPlus = this.$(".plus"), this.updateBtnStatus(this.num), this
        }
    });
    return n
}), define("zenjs/uploader/photo_uploader", ["require", "bower_components/ajax/ajax", "../util/ua"], function (t) {
    t("bower_components/ajax/ajax");
    var e = t("../util/ua"), i = function () {
    }, n = window._global, o = function () {
        if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return !1;
        var t = document.createElement("input");
        return t.type = "file", !t.disabled
    }, s = function () {
        var t = "chepinwsc" === n.platform && n.platform_version <= "3.0.0", i = e.getIOSVersion() >= 9;
        return !(i && t)
    }, a = Backbone.View.extend({
        initialize: function (t) {
            this.nInput = this.$("input"), this.nUploader = this.$("button"), this.save_to_shop = t.save_to_shop || !1, this.onValidUpload = t.onValidUpload || function () {
                    return !0
                }, this.onStartReadFile = t.onStartReadFile || i, this.onFinishReadFile = t.onFinishReadFile || i, this.onBeforeUpload = t.onBeforeUpload || i, this.onUploadSuccess = t.onUploadSuccess || i, this.onUploadError = t.onUploadError || i
        }, events: {"click input": "onInputClicked", "change input": "onFileChanged"}, render: function (t) {
            o() || (this.nInput.attr("disabled", "disabled"), this.nUploader.css("padding-left", "10px").html("您的浏览器不支持图片上传").attr("disabled", "disabled")), s() || this.nInput.on("click", function (t) {
                t.preventDefault(), motify.log("暂不支持图片上传功能")
            })
        }, onInputClicked: function (t) {
            t.target.value = ""
        }, onFileChanged: function (t) {
            var e = this, i = t.target.files;
            _.map(i, function (t, i, n) {
                if (t.size > 5242880)return void motify.log("图片太大啦~");
                if (e.onValidUpload({file: t})) {
                    e.onStartReadFile({file: t});
                    var o = new FileReader;
                    o.onload = function (i) {
                        e.onFinishReadFile({src: i.target.result, file: t})
                    }, o.readAsDataURL(t), e.getUploadToken(t)
                }
            })
        }, getUploadToken: function (t) {
            var e = this;
            if (this.uptoken)return void this.doUploadPhoto(t);
            var i = window._global.url.materials + "/dock/token.json";
            "https:" === location.protocol && (i = i.replace("http://", "https://")), $._ajax({
                url: i,
                type: "post",
                dataType: "json",
                timeout: 5e3,
                cache: !1,
                data: {scope: n.js.qn_public, kdt_id: n.kdt_id || ""},
                xhrFields: {withCredentials: !0},
                beforeSend: function () {
                },
                success: function (i) {
                    e.uptoken = i.data.uptoken, e.doUploadPhoto(t)
                },
                error: function (t, e, i) {
                },
                complete: function (t, e) {
                }
            })
        }, doUploadPhoto: function (t) {
            var e = this, i = new FormData;
            i.append("token", this.uptoken), i.append("file", t), this.save_to_shop === !1 && i.append("x:skip_save", 1);
            var o = t.name.split("."), s = "";
            o.length > 1 && (s = "." + o[o.length - 1]), i.append("x:ext", s), $._ajax({
                url: "//up.qbox.me",
                type: "post",
                data: i,
                dataType: "json",
                processData: !1,
                contentType: !1,
                timeout: 2e4,
                beforeSend: function () {
                    e.onBeforeUpload({file: t}), e.nInput.data("uploaded", "false")
                },
                success: function (i) {
                    var o = n.url.imgqn + "/" + i.data.attachment_file;
                    e.onUploadSuccess({
                        url: o,
                        file: t,
                        data: i.data
                    }), e.nInput.data("value", o), e.nInput.data("uploaded", "true")
                },
                error: function (i, n, o) {
                    e.onUploadError({file: t}), "timeout" === n && motify.log("网络环境不佳<br/>请稍后重试")
                },
                complete: function (t, e) {
                }
            })
        }
    });
    return a
}), window.Utils = window.Utils || {}, $.extend(window.Utils, {
    validMobile: function (t) {
        return t = "" + t, /^((\+86)|(86))?(1)\d{10}$/.test(t)
    }, validPhone: function (t) {
        return t = "" + t, /^0[0-9\-]{10,13}$/.test(t)
    }, validNumber: function (t) {
        return /^\d+$/.test(t)
    }, validEmail: function (t) {
        return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)
    }, validPostalCode: function (t) {
        return t = "" + t, /^\d{6}$/.test(t)
    }
}), define("wap/components/util/valid", function () {
}), define("text!wap/showcase/sku/templates/message.html", [], function () {
    return '<% if(messages.length !== 0) {%>\n    <div class=\'sku-message\'>\n        <% for (var j = 0, len = messages.length; j < len; j++) { %>\n        <dl class="clearfix">\n            <dt class="pull-left">\n                <label for="ipt-<%=j %>"><% if (messages[j].required == \'1\') { %><sup class="required">*</sup><% } %><%=messages[j].name %></label>\n            </dt>\n            <dd class="comment-wrapper clearfix">\n                <% if (messages[j].multiple == \'0\') { %>\n                    <% if (messages[j].type === \'images\') { %>\n                        <input data-valid-type="<%=messages[j].type %>" <% if (isKdtApp) { %>multiple="multiple"<% } %> <% if (messages[j].required == \'1\') { %>required<% } %> tabindex="<%=j + 1 %>" id="ipt-<%=j %>" name="message_<%=j %>" type="file" capture="camera" accept="image/*" class="js-message photo-input" >\n                        <button class="btn btn-white images-input-trigger pull-right">拍照&nbsp;或&nbsp;选择相片</button>\n                        <div class=\'images-input-show clearfix\'>\n                            <img class="hide" width=50 height=50 />\n                        </div>\n                    <% } else if(\'id_no\' === messages[j].type) {%>\n                        <input placeholder="填写中国大陆18位身份证号" data-valid-type="<%=messages[j].type %>" <% if (messages[j].required == \'1\') { %>required<% } %> tabindex="<%=j + 1 %>" id="ipt-<%=j %>" name="message_<%=j %>" type="text" data-type="<%=messages[j].type %>" class="txt js-message font-size-14" <% if (id_no.length > 0) { %>value="<%=id_no %>"<% } %> />\n                    <% } else { %>\n                        <input data-valid-type="<%=messages[j].type %>" <% if (messages[j].required == \'1\') { %>required<% } %> tabindex="<%=j + 1 %>" id="ipt-<%=j %>" name="message_<%=j %>" type="<%=messages[j].type %>" data-type="<%=messages[j].type %>" class="txt js-message font-size-14" />\n                    <% } %>\n                <% } else { %>\n                <textarea data-valid-type="<%=messages[j].type %>" <% if (messages[j].required == \'1\') { %>required<% } %> tabindex="<%=j + 1 %>" id="ipt-<%=j %>" name="message_<%=j %>" cols="32" rows="1" class="txta js-message font-size-14"></textarea>\n                <% } %>\n            </dd>\n        </dl>\n        <% } %>\n    </div>\n<% } %>\n'
}), define("wap/showcase/sku/views/message", ["require", "zenjs/uploader/photo_uploader", "wap/components/util/valid", "text!wap/showcase/sku/templates/message.html", "zenjs/util/ua"], function (t) {
    var e = t("zenjs/uploader/photo_uploader"), i = (t("wap/components/util/valid"), t("text!wap/showcase/sku/templates/message.html")), n = t("zenjs/util/ua"), o = n.isIOS(), s = "chepinwsc" === window._global.platform || "chepinwxd" === window._global.platform, a = Backbone.View.extend({
        template: _.template(i),
        initialize: function (t) {
            this.messages = this.options.messages || []
        },
        events: {"click .txtCover": "txtFocus", "blur .txt,.txta": "txtBlur"},
        txtFocus: function (t) {
            var e = $(t.target), i = e.parent().find(".txt,.txta");
            i.focus(), o && n.getIOSVersion() < 8 && (i.blur(), i.focus()), e.parent().find(".txta").attr("rows", "2"), e.css("display", "none")
        },
        txtBlur: function (t) {
            var e = $(t.target);
            e.parent().find(".txtCover").css("display", "block"), e.hasClass("txta") && e.attr("rows", "1")
        },
        render: function () {
            this.$el.html(this.template({
                messages: this.messages,
                id_no: YZLocalStorage.getItem("id_no") || "",
                isIOS: o,
                isKdtApp: s
            })), 0 === this.messages.length && this.$el.hide();
            var t = this.$(".photo-input");
            return this.photoUploaders = [], t.each(_(function (t, i) {
                var n = $(i).parent(), o = n.find("img"), s = n.find("button"), a = new e({
                    el: n,
                    onFinishReadFile: function (t) {
                        o.removeClass("hide").attr("src", t.src)
                    },
                    onBeforeUpload: function () {
                        s.html("正在上传...")
                    },
                    onUploadSuccess: function (t) {
                        o.removeClass("hide").attr("src", t.url + "!100x100.jpg"), s.html("修改")
                    },
                    onUploadError: function () {
                        s.html("重新上传")
                    }
                }).render();
                this.photoUploaders.push(a)
            }).bind(this)), o || this.$el.find("input[type=date], input[type=time]").on("mouseover mousedown mouseup select click dblclick touchstart touchmove touchend touchcancel", function (t) {
                t.stopPropagation()
            }), this
        },
        validate: function (t) {
            for (var e, i, n, o, s = this, a = this.messages, r = 0, l = a.length; l > r; r++) {
                if (e = "message_" + r, i = $.trim(t[e]), n = a[r], _.isEmpty(i)) {
                    if ("1" == n.required)return s.$el.find("#ipt-" + r).focus(), "images" == n.type ? motify.log("请上传 " + n.name + "。") : motify.log("请填写 " + n.name + "。"), !1
                } else {
                    if ("images" == n.type && (o = s.$el.find("#ipt-" + r).data("uploaded"), "false" == o || !o))return motify.log("图片还在上传中，请稍等。。"), !1;
                    if ("tel" == n.type && !Utils.validNumber(i))return s.$el.find("#ipt-" + r).focus(), motify.log("请填写正确的" + n.name + "。"), !1;
                    if ("email" == n.type && !Utils.validEmail(i))return s.$el.find("#ipt-" + r).focus(), motify.log("请填写正确的" + n.name + "。"), !1;
                    if ("id_no" == n.type && (i.length < 15 || i.length > 18))return s.$el.find("#ipt-" + r).focus(), motify.log("请填写正确的" + n.name + "。"), !1
                }
                if (i.length > 200)return motify.log(n.name + " 写的太多了<br/>不要超过200字"), !1
            }
            return !0
        },
        getData: function () {
            var t = {};
            return this.$("dl .js-message").each(function (e, i) {
                if ("file" == i.type)var n = $(i).data("value");
                t[i.name] = n || i.value || "", "id_no" === $(i).data("type") && YZLocalStorage.setItem("id_no", $(i).val())
            }), this.validate(t) ? t : null
        }
    });
    return a
}), define("zenjs/backbone/base_view", ["require", "backbone", "../core/trigger_method"], function (t) {
    var e = t("backbone"), i = t("../core/trigger_method");
    return e.View.extend({
        clean: function () {
            return this.stopListening(), this
        }, triggerMethod: i
    })
}), define("bower_components/zenlist/list", ["require", "exports", "module", "zenjs/backbone/base_view"], function (t, e, i) {
    var n = function () {
    }, o = t("zenjs/backbone/base_view");
    i.exports = o.extend({
        initialize: function (t) {
            return this.options = t = t || {}, this.items = [], this.itemView = t.itemView, this.itemOptions = t.itemOptions || {}, this.collection = t.collection, this.onAfterListChange = t.onAfterListChange || n, this.onAfterListLoad = t.onAfterListLoad || n, this.onAfterListDisplay = t.onAfterListDisplay || n, this.onListEmpty = t.onListEmpty || t.onEmptyList || this._onListEmpty, this.onItemClick = t.onItemClick || n, this.onViewItemAdded = t.onViewItemAdded || n, this.displaySize = t.displaySize || -1, this.emptyHTML = t.emptyHTML || "", this.emptyText = t.emptyText || "列表为空", this
        }, render: function (t) {
            return this.displaySize = -1 == (t || {}).displaySize ? -1 : this.displaySize, this.clean(), this._setupListeners(), this.addAll(), this.onAfterListDisplay({list: this.collection}), this
        }, fetchRender: function (t) {
            return this.collection.fetch({
                data: t, success: _(function (t, e) {
                    this.render(), this.onAfterListLoad(this.collection, e), this.onFetchSuccess && this.onFetchSuccess()
                }).bind(this), error: _.bind(function () {
                    this.onAfterListLoad(this.collection, response)
                }, this)
            }), this
        }, _setupListeners: function () {
            this.collection && (this.stopListening(this.collection), this.listenTo(this.collection, "add", this.addItem, this), this.listenTo(this.collection, "reset sort", this.render, this), this.listenTo(this.collection, "remove", this.onItemRemoved, this))
        }, addItemListeners: function (t) {
            var e = this;
            this.listenTo(t, "all", function () {
                var e = "item:" + arguments[0], i = _.toArray(arguments);
                i.splice(0, 1), i.unshift(e, t), this.trigger.apply(this, i), "item:click" == e && this.onItemClick()
            }), this.listenTo(t.model, "change", function () {
                e.onAfterListChange({list: this.collection})
            })
        }, addAll: function () {
            0 === this.collection.length ? this.fetching || this.triggerMethod("list:empty") : this.collection.each(function (t) {
                this.addItem(t)
            }, this)
        }, removeAll: function () {
            for (var t = this.items.length - 1; t >= 0; t--)this.removeView(this.items[t]);
            this.onAfterListChange({list: this.collection})
        }, addItem: function (t, e, i) {
            if (!(this.displaySize >= 0 && this.items.length >= this.displaySize)) {
                1 == this.collection.length && (this.listEl || this.$el).html("");
                var n = new this.itemView(_.extend({}, this.options.itemOptions, {
                    model: t,
                    index: this.collection.indexOf(t)
                }));
                this.items.push(n), this.addItemListeners(n), n.render(), this.onViewItemAdded({
                    list: this.items,
                    viewItem: n,
                    model: t
                });
                var o = (i || {}).at;
                return 0 === o ? (this.listEl || this.$el).prepend(n.el) : (this.listEl || this.$el).append(n.el), n
            }
        }, removeItem: function (t) {
            var e = this.getViewByModel(t);
            e && this.removeView(e)
        }, removeView: function (t) {
            var e;
            this.stopListening(t), t && (this.stopListening(t.model), t.remove(), e = this.items.indexOf(t), this.items.splice(e, 1)), 0 === this.collection.length && (this.fetching || this.triggerMethod("list:empty"))
        }, onItemRemoved: function (t) {
            this.onAfterListChange({list: this.collection, action: "remove", model: t}), this.removeItem(t)
        }, getViewByModel: function (t) {
            return _.find(this.items, function (e, i) {
                return e.model === t
            })
        }, dispatchEventToAllViews: function (t, e) {
            for (var i = this.items.length - 1; i >= 0; i--)this.items[i].trigger(t, e)
        }, remove: function () {
            o.prototype.remove.call(this, arguments), this.removeAll(), this.collection.reset(), delete this.collection
        }, clean: function () {
            o.prototype.clean.call(this, arguments), this.removeAll(), (this.listEl || this.$el).html(""), this.stopListening(this.collection)
        }, _onListEmpty: function () {
            this.$el.html(this.emptyHTML || (this.emptyText ? '<p style="text-align:center;line-height:60px;">' + this.emptyText + "</p>" : ""))
        }
    })
}), function () {
    Date.shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], Date.longMonths = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], Date.shortDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Date.longDays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
    var t = {
        d: function () {
            return (this.getDate() < 10 ? "0" : "") + this.getDate()
        }, D: function () {
            return Date.shortDays[this.getDay()]
        }, j: function () {
            return this.getDate()
        }, l: function () {
            return Date.longDays[this.getDay()]
        }, N: function () {
            return 0 === this.getDay() ? 7 : this.getDay()
        }, S: function () {
            return this.getDate() % 10 == 1 && 11 != this.getDate() ? "st" : this.getDate() % 10 == 2 && 12 != this.getDate() ? "nd" : this.getDate() % 10 == 3 && 13 != this.getDate() ? "rd" : "th"
        }, w: function () {
            return this.getDay()
        }, z: function () {
            var t = new Date(this.getFullYear(), 0, 1);
            return Math.ceil((this - t) / 864e5)
        }, W: function () {
            var t = new Date(this.valueOf()), e = (this.getDay() + 6) % 7;
            t.setDate(t.getDate() - e + 3);
            var i = t.valueOf();
            return t.setMonth(0, 1), 4 !== t.getDay() && t.setMonth(0, 1 + (4 - t.getDay() + 7) % 7), 1 + Math.ceil((i - t) / 6048e5)
        }, F: function () {
            return Date.longMonths[this.getMonth()]
        }, m: function () {
            return (this.getMonth() < 9 ? "0" : "") + (this.getMonth() + 1)
        }, M: function () {
            return Date.shortMonths[this.getMonth()]
        }, n: function () {
            return this.getMonth() + 1
        }, t: function () {
            var t = this.getFullYear(), e = this.getMonth() + 1;
            return 12 === e && (t = t++, e = 0), new Date(t, e, 0).getDate()
        }, L: function () {
            var t = this.getFullYear();
            return t % 400 === 0 || t % 100 !== 0 && t % 4 === 0
        }, o: function () {
            var t = new Date(this.valueOf());
            return t.setDate(t.getDate() - (this.getDay() + 6) % 7 + 3), t.getFullYear()
        }, Y: function () {
            return this.getFullYear()
        }, y: function () {
            return ("" + this.getFullYear()).substr(2)
        }, a: function () {
            return this.getHours() < 12 ? "am" : "pm"
        }, A: function () {
            return this.getHours() < 12 ? "AM" : "PM"
        }, B: function () {
            return Math.floor(1e3 * ((this.getUTCHours() + 1) % 24 + this.getUTCMinutes() / 60 + this.getUTCSeconds() / 3600) / 24)
        }, g: function () {
            return this.getHours() % 12 || 12
        }, G: function () {
            return this.getHours()
        }, h: function () {
            return ((this.getHours() % 12 || 12) < 10 ? "0" : "") + (this.getHours() % 12 || 12)
        }, H: function () {
            return (this.getHours() < 10 ? "0" : "") + this.getHours()
        }, i: function () {
            return (this.getMinutes() < 10 ? "0" : "") + this.getMinutes()
        }, s: function () {
            return (this.getSeconds() < 10 ? "0" : "") + this.getSeconds()
        }, u: function () {
            var t = this.getMilliseconds();
            return (10 > t ? "00" : 100 > t ? "0" : "") + t
        }, e: function () {
            return /\((.*)\)/.exec((new Date).toString())[1]
        }, I: function () {
            for (var t = null, e = 0; 12 > e; ++e) {
                var i = new Date(this.getFullYear(), e, 1), n = i.getTimezoneOffset();
                if (null === t)t = n; else {
                    if (t > n) {
                        t = n;
                        break
                    }
                    if (n > t)break
                }
            }
            return this.getTimezoneOffset() == t | 0
        }, O: function () {
            return (-this.getTimezoneOffset() < 0 ? "-" : "+") + (Math.abs(this.getTimezoneOffset() / 60) < 10 ? "0" : "") + Math.abs(this.getTimezoneOffset() / 60) + "00"
        }, P: function () {
            return (-this.getTimezoneOffset() < 0 ? "-" : "+") + (Math.abs(this.getTimezoneOffset() / 60) < 10 ? "0" : "") + Math.abs(this.getTimezoneOffset() / 60) + ":00"
        }, T: function () {
            return this.toTimeString().replace(/^.+ \(?([^\)]+)\)?$/, "$1")
        }, Z: function () {
            return 60 * -this.getTimezoneOffset()
        }, c: function () {
            return this.format("Y-m-d\\TH:i:sP")
        }, r: function () {
            return this.toString()
        }, U: function () {
            return this.getTime() / 1e3
        }
    };
    Date.prototype.format = function (e) {
        var i = this;
        return e.replace(/(\\?)(.)/g, function (e, n, o) {
            return "" === n && t[o] ? t[o].call(i) : o
        })
    }
}.call(this), define("zenjs/im/helpers/date_format", function () {
}), define("bower_components/zenjs/im/helpers/utils", ["require", "zenjs/im/helpers/date_format"], function (t) {
    t("zenjs/im/helpers/date_format");
    var e = window.Utils || {};
    return _.extend(e, {
        postMessage: function (t, e, i) {
            i = i || window.location.origin, t.postMessage(e, i)
        }, getCardTitle: function (t) {
            var e = t;
            return _.isString(t) && (t = JSON.parse(t), e = t.title), e
        }, isSupportWS: function () {
            return "WebSocket" in window && 2 === window.WebSocket.CLOSING
        }, isAndroid: function () {
            return "android" === window._global.mobile_system
        }, isHttps: function () {
            return "https:" === window.location.protocol
        }, syncSocket: function (t, e, i) {
            var n = window.socket, o = n.send(i.data, t);
            return o.done(function (t, e) {
                i.success(e)
            }).fail(function (t, e) {
                i.error(e)
            }), e.trigger("request", e, o, i), o
        }, getSocketUrl: function () {
            var t, e = window._global.run_mode || "online";
            return t = this.isHttps() ? "wss://im-ws.chepin.com:443" : "online" !== e ? "ws://192.168.66.203:6060" : "ws://180.150.190.137:6061"
        }, isTrustedDomian: function (t) {
            var e = -1 !== t.indexOf("chepin.com") || -1 !== t.indexOf("chepin.com");
            return e
        }, fixWebView: function () {
            return getComputedStyle(document.body).width
        }, checkIsLogined: function () {
            return !!window._global.buyer_id
        }, validToken: function (t) {
            var e = this;
            return t = t || $.Deferred(), this.open_token ? this.open_token.expires_remind > 0 ? t.resolve(this.open_token) : setTimeout(function () {
                e.fetchToken(t)
            }, 1e4) : this.fetchToken(t), t
        }, fetchToken: function (t) {
            var i = this, n = e.site("/common/oauth/exchangetoken.json", "wap"), o = e.ajax({
                url: n,
                type: "POST",
                xhrFields: {withCredentials: !0}
            }).done(function (e) {
                i.open_token = e, i.validToken(t)
            }).fail(function () {
                window.motify.log("获取token失败")
            });
            return o
        }, getToken: function () {
            var t = this.open_token ? this.open_token.access_token : "";
            return t
        }, getCardData: function () {
            var t = window._global.card_data || {};
            return t
        }, getBuyerId: function () {
            var t = window._global.buyer_id || 0;
            return t
        }, getKdtId: function () {
            var t = window._global.kdt_id || 0;
            return t
        }, getUserInfo: function () {
            var t = this, e = t.getMpData(), i = {pic: e.logo || "", name: e.team_name || "", alias: e.alias || ""};
            return i
        }, getMpData: function () {
            return window._global.mp_data || {}
        }, channelMap: {chepin: "wsc", weixiaodian: "wsc", pf: "ls"}, getChannel: function () {
            var t = this, e = window._global.im_channel;
            if (e)return e;
            var i = t.getMpData(), n = i.team_type || "chepin";
            return e = t.channelMap[n]
        }, getHomepage: function (t, i) {
            var n = this;
            t = t || 0, i = i || n.getChannel();
            var o = "";
            return o = "ls" === i ? e.site("/wholesale/store?kdt_id=" + t, "pf") : e.site("/showcase/homepage?kdt_id=" + t, "wap")
        }, isRetina: function () {
            return window.devicePixelRatio > 1
        }, isToday: function (t) {
            var e = new Date, i = new Date(t);
            return e.toDateString() === i.toDateString()
        }, isYesterday: function (t) {
            var e = new Date;
            e.setHours(0, 0, 0, 0);
            var i = new Date(t), n = +e - +i, o = n > 0 && 864e5 > n;
            return o
        }, dateFormat: function (t, e) {
            if (!t)return "";
            var i = new Date(t), n = i.format(e);
            return n
        }, datetimeFix: function (t) {
            var e, i = this;
            return e = i.isToday(t) ? i.dateFormat(t, "H:i:s") : i.isYesterday(t) ? i.dateFormat(t, "昨天 H:i:s") : i.dateFormat(t, "Y/m/d H:i:s")
        }, findLinks: function (t, e, i) {
            i = i || "_blank";
            var n = /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?/gi;
            return e = e || "external-link", t = t.replace(n, function (t) {
                return '<a class="' + e + '" target="' + i + '" href="' + t + '">' + t + "</a>"
            })
        }, notInIframe: function () {
            var t = window.top === window;
            return t
        }, deparam: function (t) {
            var e = {};
            if (!t)return e;
            var i = t.split("&");
            return _(i).each(function (t) {
                var i = t.split("=");
                e[i[0]] = i[1]
            }), e
        }, rtrim: function (t) {
            return t = t || "", t.replace(/(\s*$)/g, "")
        }, url: function (t) {
            var e = window.location.origin + "/v2", i = e + t;
            return i
        }, site: function (t, e) {
            var i = window._global.run_mode, n = window._global.url;
            "static" === e && "online" === i && (e = "cdn_static");
            var o = t;
            return e = e ? n[e] || "" : "", -1 === t.search(/^http[s]?\:\/\//) && (o = e + t), o
        }, fullfillImage: function (t, e, i) {
            if (t) {
                var n = [/^(https?:)?\/\/imgqn.chepin.com/, /^(https?:)?\/\/kdt-img.chepin.com/, /^(https?:)?\/\/img.yzcdn.cn/, /^(https?:)?\/\/dn-kdt-img.qbox.me/];
                i = i || {}, e = e || "";
                for (var o = 0; o < n.length; o++)t = t.replace(n[o], window._global.url.imgqn);
                if (t = t.replace("imgqntest.chepin.com", "dn-kdt-img-test.qbox.me"), t.match(/^(https?:)?\/\//i)) {
                    if (!t.match(window._global.url.imgqn) && !t.match("dn-kdt-img-test.qbox.me"))return t;
                    t.match("!") || (t += e)
                } else t = window._global.url.imgqn + "/" + t + e;
                return t = t.replace(/^https?:\/\//i, "//")
            }
        }, ajax: function (t, e) {
            var i = $.Deferred();
            return "object" == typeof t && (e = t, t = void 0), e = _.defaults(e || {}, {dataType: "json"}), i.xhr = $.ajax(e).done(function (t) {
                void 0 !== t.errcode && (t.code = t.errcode, t.msg = t.errmsg), 0 === +t.code ? i.resolve(t.data, t) : void 0 === t.code ? i.resolve(t, t) : i.reject(t.msg, t)
            }).fail(function (t, e) {
                var n = 99999;
                e = e || "数据错误", "parsererror" === e && (e = "JSON解析失败"), "abort" === e && (n = -1), i.reject(e, {
                    code: n,
                    msg: e
                })
            }), i
        }, insertText: function (t, e) {
            if ("INPUT" === t.tagName || "TEXTAREA" === t.tagName)if (document.selection) {
                t.focus();
                var i = document.selection.createRange();
                i.text = e, i.collapse(), i.select()
            } else if (t.selectionStart || "0" == t.selectionStart) {
                var n = t.selectionStart, o = t.selectionEnd;
                t.value = t.value.substring(0, n) + e + t.value.substring(o, t.value.length), t.selectionStart = t.selectionEnd = n + e.length
            } else t.value += e
        }, moveCaretToStart: function (t) {
            if ("number" == typeof t.selectionStart)t.selectionStart = t.selectionEnd = 0; else if ("undefined" != typeof t.createTextRange) {
                t.focus();
                var e = t.createTextRange();
                e.collapse(!0), e.select()
            }
        }, moveCaretToEnd: function (t) {
            if ("number" == typeof t.selectionStart)t.selectionStart = t.selectionEnd = t.value.length; else if ("undefined" != typeof t.createTextRange) {
                t.focus();
                var e = t.createTextRange();
                e.collapse(!1), e.select()
            }
        }
    }), e
}), define("text!wap/showcase/sku/templates/skuList.html", [], function () {
    return '<dt class="model-title sku-sel-title">\n    <label><%= skuCollection.k %>：</label>\n</dt>\n<dd>\n    <ul class="model-list sku-sel-list"></ul>\n</dd>'
}), define("wap/showcase/sku/views/sku_list", ["bower_components/zenlist/list", "bower_components/zenjs/im/helpers/utils", "text!wap/showcase/sku/templates/skuList.html"], function (t, e, i) {
    var n = Backbone.View.extend({
        tagName: "li",
        className: "tag sku-tag pull-left ellipsis",
        template: _.template("<%= data.name %>"),
        initialize: function (t) {
            this.onItemClick = t.onItemClick || function () {
                }, this.listenTo(this, "active", this.onActive), this.listenTo(this, "enable", this.enableView), this.listenTo(this, "disable", this.disableView)
        },
        events: {click: "onClick"},
        onClick: function (t) {
            return this.$el.hasClass("unavailable") ? !1 : (this.toggle(), void this.onItemClick({v_id: this.model.id}))
        },
        onActive: function (t) {
            t.v_id !== this.model.id && this.deActive()
        },
        toggle: function () {
            this.$el.toggleClass("tag-orangef60"), this.$el.toggleClass("active"), this.isActived = !this.isActived
        },
        active: function () {
            this.$el.addClass("tag-orangef60"), this.$el.addClass("active"), this.isActived = !0
        },
        deActive: function () {
            this.isActived && (this.$el.removeClass("tag-orangef60"), this.$el.removeClass("active"), this.isActived = !1)
        },
        disableView: function (t) {
            parseInt(this.model.get("id"), 10) == parseInt(t.value, 10) && (this.$el.addClass("unavailable"), this.enabled = !1)
        },
        enableView: function (t) {
            this.enabled || !t || "all" !== t.value && parseInt(t.value, 10) !== parseInt(this.model.get("id"), 10) || (this.$el.removeClass("unavailable"), this.enabled = !0)
        },
        isEnabled: function () {
            return this.enabled
        },
        render: function () {
            return this.$el.html(this.template(_.extend({data: this.model.toJSON()}, {}))), this.enabled = !0, this
        }
    }), o = Backbone.View.extend({
        tagName: "dl",
        className: "clearfix block-item",
        template: _.template(i),
        initialize: function (t) {
            this.skuCollection = t.skuCollection, this.onSkuActived = t.onSkuActived || function () {
                }
        },
        onItemClick: function (t) {
            this.skuListView.dispatchEventToAllViews("active", t), this.onSkuActived(this.getActivedSku())
        },
        getActivedSku: function () {
            var t = this.skuListView.items, i = _.find(t, _(function (t) {
                return t.isActived
            }).bind(this));
            if (i) {
                var n = i.model.get("imgUrl");
                return {
                    thumb: n && e.fullfillImage(n),
                    k_id: this.skuCollection.k_id,
                    k_s: this.skuCollection.k_s,
                    v_id: i.model.id
                }
            }
            return null
        },
        activeFirstSku: function () {
            if (this.skuListView.items)for (var t in this.skuListView.items) {
                var e = this.skuListView.items[t];
                if (e.isEnabled())return void e.onClick()
            }
        },
        disableSkuItem: function (t) {
            this.skuListView.dispatchEventToAllViews("disable", {value: t})
        },
        enableSkuItem: function (t) {
            this.skuListView.dispatchEventToAllViews("enable", {value: t})
        },
        enalbeAllSkuItem: function () {
            this.skuListView.dispatchEventToAllViews("enable", {value: "all"})
        },
        render: function (e) {
            return this.$el.html(this.template({skuCollection: this.skuCollection})), this.skuListView = new t({
                collection: this.skuCollection,
                el: this.$(".model-list"),
                itemView: n,
                itemOptions: {onItemClick: _(this.onItemClick).bind(this)}
            }).render(), this
        }
    });
    return o
}), define("wap/showcase/sku/views/sku_brain", [], function () {
    var t = Backbone.View.extend({
        initialize: function (t) {
            this.collection = t.collection, Backbone.EventCenter.on("active", _(this.onSkuActived).bind(this))
        }, onSkuActived: function (t) {
            var e = t.activedSkus, i = (t.clickedSku, ["s1", "s2", "s3"]);
            _.each(i, _(function (t) {
                var n = _.filter(e, function (e) {
                    return e.k_s !== t
                }), o = this.collection.filter(function (t) {
                    for (var e in n) {
                        var i = n[e];
                        if (t.get(i.k_s) !== i.v_id)return !1
                    }
                    return !0
                }), s = {};
                _.each(o, function (t) {
                    for (var e in i) {
                        var n = i[e], o = t.get(n);
                        if (0 === parseInt(o))return;
                        s[o] ? s[o].totalStock += parseInt(t.get("stock_num")) : s[o] = {
                            totalStock: parseInt(t.get("stock_num")),
                            k_s: n
                        }
                    }
                });
                for (var a in s)s[a].totalStock ? this.trigger("sku-comb:hasstock", {
                    v_id: a,
                    k_s: s[a].k_s
                }) : this.trigger("sku-comb:nostock", {v_id: a, k_s: s[a].k_s})
            }).bind(this))
        }
    });
    return t
}), define("wap/showcase/sku/model", [], function (t, e) {
    var i;
    return e = e || {}, e.SkuModel = i = Backbone.Model, e.SkuCollection = Backbone.Collection.extend({model: i}), e.SkuStockModel = Backbone.Model, e.SkuStockCollection = Backbone.Collection, e
}), define("wap/showcase/sku/views/sku_selector", ["./sku_list", "./sku_brain", "../model"], function (t, e, i) {
    var n = i.SkuStockCollection, o = i.SkuCollection, s = Backbone.View.extend({
        initialize: function (t) {
            var e = this;
            t = t || {}, this.goods_info = t.goods_info || {}, this.skuCollectionArray = [], this.sku = (t || {}).sku, e.sku.none_sku ? this.selectedSkuComb = {
                id: e.sku.collection_id,
                get: function (t) {
                    return "price" === t ? e.sku.collection_price || "" : void 0
                }
            } : _.each(this.sku.tree, _(function (t) {
                var e = new o(t.v);
                e.count = t.count, e.k = t.k, e.k_id = t.k_id, e.k_s = t.k_s, this.skuCollectionArray.push(e)
            }).bind(this)), this.skuStockCollection = new n(this.sku.list), Backbone.EventCenter.on("enable", _(this.enalbeAllSkuItem).bind(this))
        }, events: {}, onSkuActived: function (t) {
            var e = [];
            _.each(this.skuListViews, function (t) {
                var i = t.getActivedSku();
                i && e.push(i)
            }), this.selectedSkuComb = this.getSelectedSkuComb(e), this.selectedSkuThumb = this.getSelectedSkuThumb(e), Backbone.EventCenter.trigger("sku:selected", {
                skuComb: this.selectedSkuComb,
                skuThumb: this.selectedSkuThumb
            }), Backbone.EventCenter.trigger("active", {activedSkus: e, clickedSku: t})
        }, getSelectedSkuComb: function (t) {
            this.activedSkus = t;
            var e = {}, i = null;
            return _.each(t, function (t) {
                e[t.k_s] = t.v_id
            }), t.length === _.size(this.skuListViews) && (i = this.skuStockCollection.find(function (t) {
                for (var i in e)if (t.get(i) !== e[i])return !1;
                return !0
            })), i
        }, getSelectedSkuThumb: function (t) {
            var e = (this.goods_info.picture || [])[0];
            return _.each(t, function (t) {
                return t.thumb ? (e = t.thumb, !1) : void 0
            }), e
        }, diableSkuItem: function (t) {
            this.skuListViews[t.k_s].disableSkuItem(t.v_id)
        }, enableSkuItem: function (t) {
            this.skuListViews[t.k_s].enableSkuItem(t.v_id)
        }, enalbeAllSkuItem: function (t) {
            !!this.skuListViews[t.k_s] && this.skuListViews[t.k_s].enalbeAllSkuItem()
        }, autoSelect: function () {
            this.skuListViews && _.each(this.skuListViews, function (t) {
                1 === t.skuCollection.length && t.activeFirstSku()
            })
        }, getSelectedSku: function () {
            var t = _.pluck(this.sku.tree, "k_id"), e = this.sku, i = [];
            return this.selectedSkuComb ? {
                status: !0,
                sku: this.selectedSkuComb
            } : (_.each(this.activedSkus, function (e) {
                t = _.without(t, "" + e.k_id)
            }), _.each(t, function (t) {
                i.push(_.find(e.tree, function (e) {
                    return e.k_id === t
                }).k)
            }), {status: !1, errMsg: i.join(" 和 ")})
        }, render: function (i) {
            return this.skuListViews = {}, _.each(this.skuCollectionArray, _(function (e) {
                var i = new t({skuCollection: e, onSkuActived: _(this.onSkuActived).bind(this)});
                this.$el.append(i.render().el), this.skuListViews[e.k_s] = i
            }).bind(this)), this.skuBrain = new e({collection: this.skuStockCollection}), this.listenTo(this.skuBrain, "sku-comb:nostock", _(this.diableSkuItem).bind(this)), this.listenTo(this.skuBrain, "sku-comb:hasstock", _(this.enableSkuItem).bind(this)), this
        }, clear: function () {
            return this.stopListening(), Backbone.EventCenter.off("enable"), this.remove(), null
        }
    });
    return s
}), define("text!wap/showcase/sku/templates/stock.html", [], function () {
    return '<dt class="model-title stock-label pull-left">\n    <label>剩余: </label>\n</dt>\n<dd class="stock-num">\n    <%= data.stock %>\n</dd>'
}), define("wap/showcase/sku/views/sku_stock", ["text!wap/showcase/sku/templates/stock.html"], function (t) {
    var e = Backbone.View.extend({
        template: _.template(t), initialize: function (t) {
            this.hide_stock = t.hide_stock
        }, events: {}, onClick: function (t) {
        }, render: function (t) {
            return this.stock = this.stock || t.stock, !this.hide_stock && this.stock && this.$el.html(this.template({data: {stock: this.stock}})), this
        }, setNum: function (t) {
            this.stock = t, this.render({})
        }
    });
    return e
}), define("text!wap/showcase/sku/templates/title.html", [], function () {
    return "<% if (goods_info['picture'].length > 0){ %>\n    <div class=\"thumb\"><img class=\"js-goods-thumb\" src=\"<%=goods_info['picture'][0] %>\" alt=\"\"></div>\n<% } %>\n<div class=\"detail goods-base-info clearfix\">\n    <p class=\"title c-black ellipsis\"><%=goods_info['title'] %></p>\n    <div class=\"goods-price clearfix\">\n    <% if(activity){ %>\n        <div class=\"current-price pull-left c-black activity-price\">\n            <span class='price-name pull-left font-size-14 c-orange'>￥</span><i class=\"js-goods-price price font-size-18 vertical-middle c-orange\"><%=activity['price'] %></i>\n            <span class=\"price-tag vertical-middle font-size-12\"><%=activity['price_title'] %></span>\n        </div>\n        <em class=\"old-price vertical-middle font-size-14 line-through\">价格：<%=sku['old_price'] && sku['old_price'] != '0.00' && sku['old_price'] != 0.00 ? sku['old_price'] : goods_info['price'] %></em>\n    <% }else{ %>\n        <div class=\"current-price pull-left c-black\">\n            <span class='price-name pull-left font-size-14 c-orange'>￥</span><i class=\"js-goods-price price font-size-18 vertical-middle c-orange\"><%=sku['price'] && sku['price'] != '0.00' && sku['price'] != 0.00 ? sku['price'] : goods_info['price'] %></i>\n        </div>\n    <% } %>\n    <% if(goods_info['origin'] && goods_info['origin'] !== '淘价：'){ %>\n        <div class=\"original-price vertical-middle font-size-14 line-through\"><%=goods_info['origin'] %></div>\n    <% } %>\n    </div>\n</div>\n<div class=\"js-cancel sku-cancel\">\n    <div class=\"cancel-img\"></div>\n</div>\n"
}), define("wap/showcase/sku/views/sku_title", ["zenjs/util/image", "text!wap/showcase/sku/templates/title.html"], function (t, e) {
    var i = Backbone.View.extend({
        initialize: function (t) {
            this.difTitle = (t || {}).difTitle
        }, template: _.template(e), changeSkuThumb: function (e) {
            this.skuThumb = e, this.$(".js-goods-thumb").attr("src", t.toWebp(this.skuThumb + "!100x100.jpg"))
        }, changePrice: function (t) {
            this.price = t, this.$(".js-goods-price").html((t / 100).toFixed(2))
        }, getPrice: function () {
            return this.price
        }, resetPrice: function () {
            this.$(".js-goods-price").html(this.priceScope)
        }, render: function (t) {
            return this.$el.html(this.template(t)), this.priceScope = this.$el.find(".js-goods-price").text(), this
        }
    });
    return i
}), define("text!wap/components/login_popout/templates/init.html", [], function () {
    return '<form class="js-login-form popout-login" method="GET" action="">\n    <div class="header c-green center">\n        <h2>请填写您的手机号码</h2>\n    </div>\n    <fieldset class="wrapper-form font-size-14">\n        <div class="form-item">\n            <label for="phone">手机号</label>\n            <input id="phone" name="phone" type="tel" maxlength="11" autocomplete="off" placeholder="" value="<%= phone %>">\n\n        </div>\n        <div class="js-help-info font-size-12 error c-orange"></div>\n    </fieldset>\n    <div class="action-container">\n        <input type="submit" class="js-confirm btn btn-green btn-block font-size-14" value="确认手机号码" />\n    </div>\n</form>\n'
}), define("text!wap/components/login_popout/templates/login.html", [], function () {
    return '<form class="js-login-form popout-login" method="GET" action="">\n    <div class="header c-green center">\n        <h2>该号码注册过，请直接登录</h2>\n    </div>\n    <fieldset class="wrapper-form font-size-14">\n        <div class="form-item">\n            <label for="phone">手机号</label>\n            <input id="phone" name="phone" type="tel" maxlength="11" autocomplete="off" placeholder="请输入你的手机号" disabled="disabled" value="<%= phone %>">\n\n        </div>\n        <div class="form-item">\n            <label for="password">密码</label>\n            <input id="passsword" name="password"  type="password" autocomplete="off" placeholder="请输入登录密码">\n\n        </div>\n        <div class="js-help-info font-size-12 error c-orange"></div>\n    </fieldset>\n    <div class="action-container">\n        <button type="button" class="js-confirm btn btn-green btn-block font-size-14">确认</button>\n    </div>\n    <div class="bottom-tips font-size-12">\n        <span class="c-orange">如果您忘了密码，请</span><a href="javascript:;" class="js-change-pwd c-blue">点此找回密码</a>\n        <a href="javascript:;" class="js-change-phone c-blue pull-right">更换手机号</a>\n    </div>\n</form>\n'
}), define("text!wap/components/login_popout/templates/register.html", [], function () {
    return '<form class="js-login-form popout-login" method="GET" action="">\n    <div class="header c-green center">\n        <h2>注册车品网帐号</h2>\n    </div>\n    <fieldset class="wrapper-form font-size-14">\n        <div class="form-item">\n            <label for="phone">手机号</label>\n            <input id="phone" name="phone" type="tel" maxlength="11" autocomplete="off" placeholder="请输入你的手机号" disabled="disabled" value="<%= phone %>">\n\n        </div>\n        <div class="form-item js-images-verify hide">\n            <label for="verifycode">身份校验</label>\n            <input id="verifycode" name="verifycode" class="js-verify-code item-input"  type="tel" style="width:178px" maxlength="6" autocomplete="off" placeholder="输入右侧数字">\n\n            <img class="js-verify-images verify-images" src="">\n        </div>\n        <div class="form-item">\n            <label for="code">验证码</label>\n            <input id="code" name="code"  type="text" style="width:178px" maxlength="6" autocomplete="off" placeholder="输入短信验证码">\n\n            <button type="button" class="js-auth-code tag btn-auth-code tag-green font-size-12" data-text="获取验证码">\n                获取验证码\n            </button>\n        </div>\n        <div class="form-item">\n            <label for="password">密码</label>\n            <input id="passsword" name="password"  type="password" autocomplete="off" maxlength="20" placeholder="请输入8-20位数字和字母组合">\n\n        </div>\n        <div class="js-help-info font-size-12 error c-orange"></div>\n    </fieldset>\n    <div class="action-container">\n        <button type="button" class="js-confirm btn btn-green btn-block font-size-14">确认</button>\n    </div>\n    <div class="bottom-tips font-size-12">\n        <span class="c-orange">如果您忘了密码，请</span><a href="javascript:;" class="js-change-pwd c-blue">点此找回密码</a>\n        <a href="javascript:;" class="js-change-phone c-blue pull-right">更换手机号</a>\n    </div>\n</form>\n'
}), define("text!wap/components/login_popout/templates/change_pwd.html", [], function () {
    return '<form class="js-login-form popout-login" method="GET" action="">\n    <div class="header c-green center">\n        <h2><%if(isSetting){%>设定<%}else{%>找回<%}%>帐号密码</h2>\n    </div>\n    <fieldset class="wrapper-form font-size-14">\n        <div class="form-item">\n            <label for="phone">手机号</label>\n            <input id="phone" name="phone" type="tel" maxlength="11" autocomplete="off" placeholder="请输入你的手机号" disabled="disabled" value="<%= phone %>">\n\n        </div>\n        <div class="form-item js-images-verify hide">\n            <label for="verifycode">身份校验</label>\n            <input id="verifycode" name="verifycode" class="js-verify-code item-input"  type="tel" style="width:178px" maxlength="6" autocomplete="off" placeholder="输入右侧数字">\n\n            <img class="js-verify-images verify-images" src="">\n        </div>\n        <div class="form-item">\n            <label for="code">验证码</label>\n            <input id="code" name="code"  type="text" style="width:178px" maxlength="6" autocomplete="off" placeholder="输入短信验证码">\n\n            <button type="button" class="js-auth-code tag btn-auth-code font-size-12 tag-green" data-text="获取验证码">\n                获取验证码\n            </button>\n        </div>\n        <div class="form-item">\n            <label for="password">密码</label>\n            <input id="passsword" name="password"  type="password" autocomplete="off" placeholder="设置新的8-20位数字和字母组合密码">\n\n        </div>\n        <div class="js-help-info font-size-12 error c-orange"></div>\n    </fieldset>\n    <div class="action-container">\n        <button type="button" class="js-confirm btn btn-green btn-block font-size-14">确定</button>\n    </div>\n    <div class="bottom-tips pull-right">\n        <a href="javascript:;" class="js-login inline-item c-blue">已有帐号登录</a>\n        <a href="javascript:;" class="js-register inline-item c-blue">注册新帐号</a>\n    </div>\n</form>\n'
}), window.Zepto && function (t) {
    t.fn.serializeArray = function () {
        var e, i, n = [], o = function (t) {
            return t.forEach ? t.forEach(o) : void n.push({name: e, value: t})
        };
        return this[0] && t.each(this[0].elements, function (n, s) {
            i = s.type, e = s.name, e && "fieldset" != s.nodeName.toLowerCase() && !s.disabled && "submit" != i && "reset" != i && "button" != i && "file" != i && ("radio" != i && "checkbox" != i || s.checked) && o(t(s).val())
        }), n
    }, t.fn.serialize = function () {
        var t = [];
        return this.serializeArray().forEach(function (e) {
            t.push(encodeURIComponent(e.name) + "=" + encodeURIComponent(e.value))
        }), t.join("&")
    }, t.fn.submit = function (e) {
        if (0 in arguments)this.bind("submit", e); else if (this.length) {
            var i = t.Event("submit");
            this.eq(0).trigger(i), i.isDefaultPrevented() || this.get(0).submit()
        }
        return this
    }
}(Zepto), define("vendor/zepto/form", function () {
}), window.Utils = window.Utils || {}, define("wap/components/util/form", ["vendor/zepto/form"], function (t) {
    window.Utils.getFormData = function (t) {
        var e = t.serializeArray(), i = {};
        return $.map(e, function (t) {
            i[t.name] = t.value
        }), i
    }
}), define("zenjs/sms_fetch/main", ["require", "exports", "module", "bower_components/ajax/ajax", "jquery"], function (t, e, i) {
    function n() {
        this.loadingLock = !1, this.isUsed = void 0
    }

    function o(t) {
        t = t || {}, this.$el = s(t.el || t.$el || "<div></div>"), this.el = this.$el[0], this.$ = function (t) {
            return this.$el.find(t)
        }, this.initialize && this.initialize(t)
    }

    t("bower_components/ajax/ajax");
    var s = t("jquery"), a = function () {
    };
    n.prototype = {
        fetch: function () {
            if (this.isUsed !== !1) {
                var t = this;
                this.loadingLock = !0, s._ajax({
                    url: window._global.url.www.replace(/^https?:\/\//, "//") + "/common/token/token.jsonp",
                    type: "get",
                    dataType: "jsonp"
                }).done(function (e) {
                    0 == e.code ? (t.token = e.data, t.loadingLock = !1, t.isUsed = !1) : motify.log(e.msg)
                }).fail(function () {
                    motify.log("token 获取失败")
                })
            }
        }, get: function () {
            return this.isUsed = !0, this.token
        }
    };
    var r = new n;
    s.extend(o.prototype, {
        initialize: function (t) {
            this.duration = t.time || 60, this.step = t.step || 1100, this.codeVerifyClass = t.codeVerifyClass || "js-verify-code", this.verifyType = "smsFetch";
            var e = window._global.url.www.replace(/^https?:\/\//, "//");
            this.smsFetchUrl = e + "/common/sms/captcha.jsonp", this.imgUrl = e + "/common/sms/imgcaptcha", this.imgVerifyUrl = e + "/common/sms/imgcaptcha.jsonp", this.biz = t.biz || "kdt_account_captcha", this.onTimeChange = t.onTimeChange || a, this.onTimeEnd = t.onTimeEnd || a, this.onTimerStart = t.onTimerStart || a, this.onTimerClose = t.onTimerClose || a, this.onVerifyPictureShow = t.onVerifyPictureShow || a, this.onGetCodeError = t.onGetCodeError || a, this.onVerifyPictureSuccess = t.onVerifyPictureSuccess || a, this.onVerifyPictureError = t.onVerifyPictureError || a, this.platform = t.platform || "", this.subFrom = t.subFrom || "", r.fetch()
        }, setMobile: function (t) {
            t && (this.mobile = t)
        }, getImageCode: function () {
            return s.trim(this.$("." + this.codeVerifyClass).val())
        }, getSms: function (t) {
            var e = this;
            if (r.loadingLock)return void motify.log("数据加载中，稍后再试");
            if (t = t || {}, t.mobile && (this.mobile = t.mobile), !this.mobile)return !1;
            var i = {smsFetch: e.onSmsFetchHandler, images: e.onImageHandler};
            return e.startTimer.call(e), (i[e.verifyType] || a).call(e), this
        }, startTimer: function () {
            this.onTimerStart(), this.btnCountdown(this.duration)
        }, stopTimer: function () {
            clearTimeout(this.timer), this.onTimerClose()
        }, btnCountdown: function (t) {
            var e = this;
            this.onTimeChange({second: t}), --t >= 0 ? this.timer = setTimeout(function () {
                e.btnCountdown(t)
            }, this.step) : (this.onTimeEnd(), this.timer = "")
        }, onVerifyImageShow: function (t) {
            this.$(".js-images-verify").removeClass("hide"), this.$(".js-verify-images").attr("src", t)
        }, onVerifyImageHide: function () {
            this.$(".js-images-verify").addClass("hide")
        }, onSmsFetchHandler: function () {
            var t = 1;
            return function () {
                var e = this, i = {verifyTimes: t, mobile: this.mobile, biz: this.biz, token: r.get()};
                this.platform && (i.platform = this.platform), this.subFrom && (i.sub_from = this.subFrom), s._ajax({
                    url: this.smsFetchUrl,
                    dataType: "jsonp",
                    data: i,
                    success: function (i) {
                        return 0 == i.code ? void t++ : (e.stopTimer.call(e), e.onGetCodeError.call(e), void(10111 === i.code ? (e.verifyType = "images", e.onVerifyImageShow(e.imgUrl), e.onVerifyPictureShow()) : (t++, motify.log(i.msg))))
                    },
                    error: function (i, n, o) {
                        t++, e.stopTimer.call(e), e.onGetCodeError.call(e), motify.log("获取验证码失败，请稍后再试")
                    },
                    complete: function (t, e) {
                    }
                }).always(function () {
                    r.fetch()
                })
            }
        }(), onImageHandler: function () {
            var t = this, e = this.mobile;
            s._ajax({
                url: this.imgVerifyUrl,
                dataType: "jsonp",
                data: {mobile: e, captcha_code: this.getImageCode()},
                success: function (i) {
                    return 0 === i.code ? (t.verifyType = "smsFetch", t.mobile = e, t.onVerifyImageHide(), t.onVerifyPictureSuccess(), void t.onSmsFetchHandler()) : (t.stopTimer.call(t), t.onVerifyPictureError.call(t), void(10100 === i.code ? (motify.log(i.msg), t.$el.find(".js-verify-images").attr("src", t.imgUrl)) : motify.log(i.msg)))
                },
                error: function (e, i, n) {
                    t.stopTimer.call(t), t.onVerifyPictureError.call(t), motify.log("图形验证失败，重试一下吧~"), t.$el.find(".js-verify-images").attr("src", t.imgUrl)
                },
                complete: function (t, e) {
                }
            })
        }
    }), i.exports = o
}), define("wap/components/app_h5/main", ["require", "exports", "module"], function (t, e, i) {
    i.exports = {
        currentUrl: "", currentTime: Date.now(), doCall: function (t, e) {
            window.onReady("YouzanJSBridge", function () {
                window.YouzanJSBridge.doCall(t, e)
            })
        }, compareVersion: function (t, e) {
            for (t = t.split(".").join(""), e = e.split(".").join(""); t.length !== e.length;)t.length > e.length ? e += "0" : t += "0";
            return t = Number(t), e = Number(e), t > e ? "gt" : t === e ? "eq" : "lt"
        }, eq: function (t, e) {
            return "eq" === this.compareVersion(t, e) ? !0 : !1
        }, gte: function (t, e) {
            var i = this.compareVersion(t, e);
            return "eq" === i || "gt" === i ? !0 : !1
        }, lte: function (t, e) {
            var i = this.compareVersion(t, e);
            return "eq" === i || "lt" === i ? !0 : !1
        }, configNative: function (t) {
            this.doCall("configNative", t)
        }, getData: function (t, e) {
            e.datatype = t, this.doCall("getData", e)
        }, putData: function (t, e) {
            if ("chepinwxd" === _global.platform)if (this.gte(_global.platform_version, "1.5.0"))e.datatype = t, this.doCall("putData", e); else switch (t) {
                case"supplierInfo":
                    this.doCall("tellSupplierInfo", {supplier_kdt_id: e.supplier_kdt_id});
                    break;
                case"goodsInfo":
                    this.doCall("tellGoodsInfo", {goods_id: e.goods_id})
            } else e.datatype = t, this.doCall("putData", e)
        }, gotoWebview: function (t) {
            if (this.currentUrl === t.url && Date.now() - this.currentTime < 100)this.currentTime = Date.now(); else if (this.currentUrl = t.url, this.currentTime = Date.now(), "chepinwxd" === _global.platform)if (this.gte(_global.platform_version, "1.5.0"))this.doCall("gotoWebview", t); else switch (t.page) {
                case"supplierHomepage":
                    this.doCall("goHomePage", {homeurl: t.url, name: t.name});
                    break;
                case"goodsList":
                    this.doCall("viewGoodsList", {url: t.url});
                    break;
                case"goodsDetail":
                    this.doCall("viewGoodsDetail", {
                        detail_url: t.url,
                        average_profit: t.average_profit,
                        alias: t.alias,
                        seller_goods_alias: t.seller_goods_alias
                    });
                    break;
                case"newsDetail":
                    this.doCall("viewNewsDetail", {detail_url: t.url})
            } else this.doCall("gotoWebview", t)
        }, gotoNative: function (t) {
            if ("chepinwxd" === _global.platform)if (this.gte(_global.platform_version, "1.5.0"))this.doCall("gotoNative", t); else switch (t.page) {
                case"addGoods":
                    this.doCall("addGoodsToShop", {alias: t.alias, seller_goods_alias: t.seller_goods_alias})
            } else this.doCall("gotoNative", t)
        }, doAction: function (t) {
            if ("chepinwxd" === _global.platform)if (this.gte(_global.platform_version, "1.5.0"))this.doCall("doAction", t); else switch (t.action) {
                case"back":
                    this.doCall("gotoLogin", {});
                    break;
                case"appWXPay":
                    this.doCall("appWXPay", {kdt_id: t.kdt_id, order_no: t.order_no});
                    break;
                case"deliverGoods":
                    this.doCall("deliverGoods", {order_number: t.order_number})
            } else if ("chepinwsc" === _global.platform)if (this.gte(_global.platform_version, "2.8.5"))this.doCall("doAction", t); else switch (t.action) {
                case"back":
                    this.doCall("previousStep", {})
            }
        }, onAddGoodsSuccess: function (t) {
            window.onReady("YouzanJSBridge", function () {
                window.YouzanJSBridge.on("addGoodsSuccess", function (e) {
                    t(e)
                })
            })
        }, on: function (t, e) {
            window.onReady("YouzanJSBridge", function () {
                window.YouzanJSBridge.on("dataReady", function (i) {
                    var n = i.datatype, o = i.data, s = {};
                    if ("object" == typeof o)s = o; else try {
                        s = JSON.parse(o)
                    } catch (a) {
                    }
                    n === t && e(s)
                })
            })
        }
    }
}), define("zenjs/util/url", [], function () {
    var t = {
        site: function (t, e) {
            var i = window._global.env, n = window._global.url;
            "static" === e && "online" === i && (e = "cdn_static");
            var o = t;
            return e = e ? n[e] || "" : "", -1 == t.search(/^http[s]?\:\/\//) && ("/" !== t[0] && (t = "/" + t), o = e + t), o
        }
    };
    return t
}), define("wap/components/login_popout/main", ["text!wap/components/login_popout/templates/init.html", "text!wap/components/login_popout/templates/login.html", "text!wap/components/login_popout/templates/register.html", "text!wap/components/login_popout/templates/change_pwd.html", "wap/components/util/valid", "wap/components/util/form", "zenjs/sms_fetch/main", "wap/components/app_h5/main", "zenjs/util/ua", "zenjs/util/url"], function (t, e, i, n, o, s, a, r, l, d) {
    var c = ["chepinmars"], u = Backbone.View.extend({
        events: {
            "click .js-confirm": "onConfirmClicked",
            "click .js-change-phone": "onChangePhoneClicked",
            "click .js-change-pwd": "onChangePwdClicked",
            "click .js-login": "onLoginClicked",
            "click .js-register": "onRegisterClicked",
            "click .js-auth-code": "onAuthcodeClicked",
            "submit .js-login-form": "onConfirmClicked"
        }, initialize: function (o) {
            o = o || {};
            var s = l.getPlatform();
            if (c.indexOf(s) > -1)return void(window.location.href = d.site("/buyer/kdtunion?redirect_uri=" + window.location.href, "wap"));
            var r = this;
            this.tpl_map = {
                init: _.template(o.initTpl || t),
                login: _.template(o.loginTpl || e),
                register: _.template(o.registerTpl || i),
                changePwd: _.template(o.changePwdTpl || n)
            }, this.valid_map = {
                checkPhone: _(this.checkPhone).bind(this),
                checkPwd: _(this.checkPwd).bind(this),
                checkCode: _(this.checkCode).bind(this)
            }, this.renderOpt = o.renderOpt || {
                    type: "init",
                    phone: ""
                }, this.afterLogin = o.afterLogin, this.urlMap = {
                login: o.loginUrl || "",
                register: o.registerUrl || "",
                changePwd: o.changePwdUrl || "",
                confirm: o.confirmUrl || ""
            }, this.source = o.source || 2, this.ajaxType = o.ajaxType || "POST";
            var u, h;
            l.isMobile ? (u = "app", h = "wsc", l.isWxd() ? h = "wxd" : l.isWsc() ? h = "wsc" : l.isPf() ? h = "pf" : u = "wap") : u = "pc", this.sms = new a({
                el: this.$el,
                onTimeChange: function (t) {
                    var e = t.second;
                    $(r.nAuthCode).text("等待 " + e + "秒")
                },
                onTimeEnd: function () {
                    r.nAuthCode.text("再次获取"), r.nAuthCode.prop("disabled", !1), r.nAuthCode.removeClass("disabled"), r.nCodeInput.attr("placeholder", "没有收到验证码？")
                },
                onTimerStart: function () {
                    r.nAuthCode.prop("disabled", !0), r.nAuthCode.addClass("disabled")
                },
                onVerifyPictureError: function () {
                    r.nAuthCode.removeAttr("disabled"), r.nAuthCode.removeClass("disabled"), r.nAuthCode.text("再次获取")
                },
                onGetCodeError: function () {
                    r.nAuthCode.removeAttr("disabled"), r.nAuthCode.removeClass("disabled"), r.nAuthCode.text("再次获取")
                },
                onVerifyPictureShow: function () {
                    r.nHelpInfo.html("操作过于频繁，请先输入图像验证码再获取")
                },
                onVerifyPictureSuccess: function () {
                    r.nHelpInfo.html("")
                },
                platform: u,
                subFrom: h
            })
        }, render: function () {
            return this.appLogined ? this : (this.$el.html(this.tpl_map[this.renderOpt.type](this.renderOpt)), this.nForm = this.$(".js-login-form"), this.nHelpInfo = this.$(".js-help-info"), this.nPhone = this.$('input[name="phone"]'), this.nPwd = this.$('input[name="password"]'), this.nCodeInput = this.$('input[name="authcode"]'), this.nAuthCode = this.$(".js-auth-code"), this)
        }, show: function (t, e) {
            "changePwd" == t ? this.sms.biz = "reset_account_passwd" : this.sms.biz = "kdt_account_captcha", _.extend(this.renderOpt, {type: t}, e || {isSetting: !1}), this.render(this.renderOpt), this.$el.show(this.animationTime)
        }, onConfirmClicked: function (t) {
            t.preventDefault();
            var e = this, i = $(t.target), n = Utils.getFormData(e.nForm);
            if (n = _.extend(e.renderOpt, n), !e.validate(n))return !1;
            n.source = this.source;
            var o = i.html();
            if ("init" === e.renderOpt.type)e.renderOpt.phone = n.phone, $._ajax({
                url: this.urlMap.confirm,
                type: "POST",
                dataType: "json",
                timeout: 15e3,
                data: n,
                beforeSend: function () {
                    i.html("确认中..."), i.prop("disabled", !0)
                },
                success: function (t) {
                    switch (+t.code) {
                        case 0:
                            e.show("login");
                            break;
                        case 200:
                            e.show("register");
                            break;
                        case 300:
                            e.show("changePwd", {isSetting: !0});
                        default:
                            e.nHelpInfo.html(t.msg)
                    }
                },
                error: function () {
                    e.nHelpInfo.html("出错啦，请重试")
                },
                complete: function () {
                    i.html(o), i.prop("disabled", !1)
                }
            }); else {
                var s = e.renderOpt.type;
                $._ajax({
                    url: this.urlMap[s],
                    type: this.ajaxType,
                    dataType: "json",
                    timeout: 15e3,
                    data: n,
                    beforeSend: function () {
                        i.html("确认中..."), i.prop("disabled", !0)
                    },
                    success: function (t) {
                        0 === t.code ? e.afterLogin(t, {type: s}) : e.nHelpInfo.html(t.msg)
                    },
                    error: function () {
                        e.nHelpInfo.html("出错啦，请重试")
                    },
                    complete: function () {
                        i.html(o), i.prop("disabled", !1)
                    }
                })
            }
        }, onAuthcodeClicked: function (t) {
            t.preventDefault();
            var e = this, i = Utils.getFormData(e.nForm);
            i = _.extend(e.renderOpt, i);
            var n = i.phone;
            this.sms.setMobile(n), this.sms.getSms()
        }, onChangePhoneClicked: function (t) {
            t.preventDefault(), this.show("init")
        }, onChangePwdClicked: function (t) {
            t.preventDefault(), this.sms.stopTimer(), this.show("changePwd")
        }, onLoginClicked: function (t) {
            t.preventDefault(), this.show("init")
        }, onRegisterClicked: function (t) {
            t.preventDefault(), this.show("init")
        }, validate: function () {
            var t = {
                init: ["checkPhone"],
                login: ["checkPwd"],
                register: ["checkCode", "checkPwd"],
                changePwd: ["checkCode", "checkPwd"]
            };
            return function (e) {
                return _.every(t[e.type], _(function (t) {
                    return this.valid_map[t](e)
                }).bind(this))
            }
        }(), checkPhone: function (t) {
            return "" === t.phone ? (this.nPhone.focus(), this.nHelpInfo.html("请填写您的手机号码"), !1) : window.Utils.validMobile(t.phone) ? !0 : (this.nPhone.focus(), this.nHelpInfo.html("请填写11位手机号码"), !1)
        }, checkPwd: function (t) {
            function e(t) {
                var e = /[a-zA-Z]/g, i = /[0-9]/g, n = 0, o = e.test(t), s = i.test(t);
                return o && s && (n = 1), n
            }

            if ("" === t.password)return this.nPwd.focus(), this.nHelpInfo.html("请输入您的密码"), !1;
            if ("login" !== this.renderOpt.type && t.password.length < 8)return this.nPwd.focus(), this.nHelpInfo.html("亲，密码最短为8位"), !1;
            if ("login" !== this.renderOpt.type && t.password.length > 20)return this.nPwd.focus(), this.nHelpInfo.html("亲，密码太长为20位"), !1;
            if ("login" !== this.renderOpt.type) {
                var i = e(t.password);
                if (!i)return this.nPwd.focus(), this.nHelpInfo.html("亲，密码为8-20位数字和字母组合"), !1
            }
            return !0
        }, checkCode: function (t) {
            return window.Utils.validPostalCode(t.code) ? !0 : (this.nCodeInput.focus(), this.nHelpInfo.html("请填写6位短信验证码"), !1)
        }
    });
    return u
}), define("zenjs/util/number", [], function () {
    var t = {
        makeRandomString: function (t) {
            var e = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
            t = t || 10;
            for (var n = 0; t > n; n++)e += i.charAt(Math.floor(Math.random() * i.length));
            return e
        }
    };
    return t
}), define("bower_components/pop/pop", ["require", "zenjs/events", "zenjs/util/number"], function (t) {
    var e = function () {
    }, i = t("zenjs/events"), n = t("zenjs/util/number");
    window.zenjs = window.zenjs || {};
    var o = i.extend({
        init: function (t) {
            this._window = $(window);
            var i = n.makeRandomString();
            $("body").append('<div id="' + i + '"                 style="display:none; height: 100%;                 position: fixed; top: 0; left: 0; right: 0;                background-color: rgba(0, 0, 0, ' + (t.transparent || ".9") + ');z-index:1000;opacity:0;transition: opacity ease 0.2s;"></div>'), this.nBg = $("#" + i), this.nBg.on("click", $.proxy(function () {
                this.isCanNotHide || this.hide()
            }, this));
            var o = n.makeRandomString();
            $("body").append('<div id="' + o + '" class="' + (t.className || "") + '" style="overflow:hidden;visibility: hidden;"></div>'), this.nPopContainer = $("#" + o), this.nPopContainer.hide(), t.contentViewClass && (this.contentViewClass = t.contentViewClass, this.contentViewOptions = $.extend({el: this.nPopContainer}, t.contentViewOptions || {}), this.contentView = new this.contentViewClass($.extend({onHide: $.proxy(this.hide, this)}, this.contentViewOptions)), this.contentView.onHide = $.proxy(this.hide, this)), this.animationTime = t.animationTime || 300, this.isCanNotHide = t.isCanNotHide, this.doNotRemoveOnHide = t.doNotRemoveOnHide || !1, this.onShow = t.onShow || e, this.onHide = t.onHide || e, this.onFinishHide = t.onFinishHide || e, this.html = t.html
        }, render: function (t) {
            return this.renderOptions = t || {}, this.contentViewClass ? this.contentView.render(this.renderOptions) : this.html && this.nPopContainer.html(this.html), this
        }, show: function () {
            return this.top = this._window.scrollTop(), this.nBg.show().css({
                opacity: "1",
                "transition-property": "none"
            }), this.nPopContainer.show(), setTimeout($.proxy(function () {
                this._window.scrollTop(0), this.startShow(), this.nPopContainer.show().css("visibility", "visible"), this._doShow && this._doShow(), this.onShow()
            }, this), 200), this
        }, hide: function () {
            var t, e = function (i) {
                return t !== this._window.scrollTop() && i > 0 ? (this._window.scrollTop(t), void setTimeout($.proxy(e, this, i - 1))) : void setTimeout($.proxy(this.onFinishHide, this), 50)
            };
            return function (i) {
                i = i || {};
                var n = i.doNotRemove || this.doNotRemoveOnHide || !1;
                this._doHide && this._doHide(), setTimeout($.proxy(function () {
                    this.startHide(), t = this.top, this._window.scrollTop(t), $.proxy(e, this)(2), this.nBg.css({
                        opacity: 0,
                        "transition-property": "opacity"
                    }), setTimeout($.proxy(function () {
                        this.nBg.hide(), this.nPopContainer.hide(), n || this.destroy(), window.zenjs.popList.length < 1 && $("html").css("position", this.htmlPosition)
                    }, this), 200)
                }, this), this.animationTime), this.onHide()
            }
        }(), destroy: function () {
            return this.nPopContainer.remove(), this.nBg.remove(), this.contentView && this.contentView.remove(), this
        }, startShow: function () {
            var t = window.zenjs.popList;
            if (t || (t = window.zenjs.popList = []), 0 === t.length) {
                var e = $("body"), i = $("html");
                this.htmlPosition = i.css("position"), i.css("position", "relative"), this.bodyCss = (e.prop("style") || {}).cssText, this.htmlCss = (i.prop("style") || {}).cssText, $("body,html").css({
                    overflow: "hidden",
                    height: this._window.height()
                })
            }
            t.indexOf(this) < 0 && t.push(this)
        }, startHide: function () {
            var t = window.zenjs.popList, e = t.indexOf(this);
            e > -1 && t.splice(e, 1), t.length < 1 && ($("html").attr("style", this.htmlCss || ""), $("body").attr("style", this.bodyCss || ""))
        }
    });
    return o
}), define("bower_components/pop/popout", ["require", "./pop"], function (t) {
    var e = t("./pop"), i = e.extend({
        init: function (t) {
            t = t || {}, this._super(t), this.css = $.extend({
                position: "absolute",
                "z-index": 1e3,
                transition: "opacity ease " + this.animationTime + "ms",
                opacity: 0,
                top: "50%",
                left: "50%",
                "-webkit-transform": "translate3d(-50%, -50%, 0)",
                transform: "translateY(-50%, -50%, 0)"
            }, t.css || {}), this.nPopContainer.css(this.css)
        }, _doShow: function () {
            $(".js-popout-close").click($.proxy(function (t) {
                this.hide()
            }, this)), this.nPopContainer.css("opacity", 1), this.nPopContainer.show()
        }, _doHide: function (t) {
            this.nPopContainer.css({opacity: 0})
        }
    });
    return i
}), define("bower_components/pop/popout_box", ["require", "./popout"], function (t) {
    var e = function () {
    }, i = t("./popout"), n = i.extend({
        init: function (t) {
            this._super(t), this._onOKClicked = t.onOKClicked || e, this._onCancelClicked = t.onCancelClicked || e, this.preventHideOnOkClicked = t.preventHideOnOkClicked || !1, this.width = t.width, this.setEventListener()
        }, setEventListener: function () {
            this.nPopContainer.on("click", ".js-ok", $.proxy(this.onOKClicked, this)), this.nPopContainer.on("click", ".js-cancel", $.proxy(this.onCancelClicked, this))
        }, _doShow: function () {
            this.boxCss = {
                "border-radius": "4px",
                background: "white",
                width: this.width || "270px",
                padding: "15px"
            }, this.nPopContainer.css(this.boxCss).addClass("popout-box"), this._super()
        }, _doHide: function (t) {
            this._super()
        }, onOKClicked: function (t) {
            this._onOKClicked(t), !this.preventHideOnOkClicked && this.hide()
        }, onCancelClicked: function (t) {
            this._onCancelClicked(t), this.hide()
        }
    });
    return n
}), window.Utils = window.Utils || {}, $.extend(window.Utils, {
    needConfirm: function (t, e, i) {
        var n = window.confirm(t);
        n ? e && "function" == typeof e && e.apply() : i && "function" == typeof i && i.apply()
    }
}), define("wap/components/util/confirm", function () {
}), define("zenjs/util/jump_to_url", ["require", "bower_components/chepinjsbridge/api"], function (t) {
    var e = t("bower_components/chepinjsbridge/api"), i = function (t) {
        "chepinmars" == _global.platform ? e.gotoWebview({page: "web", url: t}) : location.href = t
    };
    return i
}), define("text!wap/showcase/sku/templates/buyBtn.html", [], function () {
    return '<% if(!isMultiBtn) {%>\n    <a href="javascript:;" class="js-confirm-it btn btn-block btn-orange-dark">下一步</a>\n<% } else {\n    if(!isCartBtnHide) {%>\n        <div class="half-button">\n            <a href="javascript:;" class="js-mutiBtn-confirm confirm btn btn-block btn-orange-dark ">立即购买</a>\n        </div>\n    <% } else {%>\n        <a href="javascript:;" class="js-mutiBtn-confirm confirm btn btn-block btn-orange-dark">下一步</a>\n    <%}\n}%>\n'
}), define("text!wap/showcase/sku/templates/skuContainer.html", [], function () {
    return '<div class="layout-title sku-box-shadow name-card sku-name-card">\n</div>\n\n<div class="adv-opts layout-content">\n    <div class="goods-models js-sku-views block block-list border-top-0"></div>\n    <div class="confirm-action content-foot clearfix"></div>\n</div>'
}), define("css", [], function () {
    var t = {};
    return t.normalize = function (t, e) {
        return ".css" == t.substr(t.length - 4, 4) && (t = t.substr(0, t.length - 4)), e(t)
    }, t
}), define("css!components_css/sku_layout", [], function () {
}), require(["bower_components/wap_common/base/make_url_log", "bower_components/chepinjsbridge/api", "zenjs/backbone/quantity", "wap/showcase/sku/views/message", "wap/showcase/sku/views/sku_selector", "wap/showcase/sku/views/sku_stock", "wap/showcase/sku/views/sku_title", "wap/components/login_popout/main", "bower_components/pop/popout_box", "wap/components/util/confirm", "zenjs/util/args", "vendor/zepto/form", "zenjs/util/jump_to_url", "text!wap/showcase/sku/templates/buyBtn.html", "text!wap/showcase/sku/templates/skuContainer.html", "css!components_css/sku_layout"], function (t, e, i, n, o, s, a, r, l, d, c, u, h, p, m) {
    var f = function () {
    };
    Backbone.EventCenter = _.extend({}, Backbone.Events);
    var g = Backbone.View.extend({
        initialize: function (t) {
            t = t || {}, this.skuViewConfig = _.extend({
                bottom: 0,
                left: 0,
                right: 0,
                top: 40
            }, t.skuViewConfig || {}), this.baseUrl = t.baseUrl, this.need_ajax_login = t.need_ajax_login || !1, this.wxpay_env = t.wxpay_env, this.isCartBtnHide = t.isCartBtnHide, this.quantityReadOnly = t.quantityReadOnly, this.isPriceCanChanged = !0, this.onAddSuccess = t.onAddSuccess || f, this.inited = !1, this.onHide = t.onHide || function () {
                }, this.viewTop = this.skuViewConfig.top, delete this.skuViewConfig.top, this.deviceView = {
                width: $(document).width(),
                height: $(document).height()
            }, this.bodyPos = $("html").css("position"), this.nActionBtnTemplate = _.template(p), this.nPrice = this.$(".js-goods-price"), Backbone.EventCenter = _.extend({}, Backbone.Events), Backbone.EventCenter.on("sku:selected", _(this.onSelectChange).bind(this))
        },
        render: function (t) {
            if (t = t || {}, this.sku = t.sku || {}, this.goods_id = t.goods_id, this.kdt_id = t.kdt_id || window._global.kdt_id, this.postage = t.postage, this.activity = t.activity, this.activity_alias = t.activity_alias || "", this.activity_id = t.activity_id || 0, this.activity_type = t.activity_type || 0, this.quota = t.quota, this.quota_used = t.quota_used, this.stockNum = t.stock || this.sku.stock_num, this.isGift = t.isGift, this.is_virtual = t.is_virtual, this.isAddCart = t.isAddCart, this.isAddWish = t.isAddWish, this.isMultiBtn = t.isMultiBtn || !1, this.onAfterHideFunc = t.onAfterHideFunc || function () {
                    }, this.goods_info = t.goods_info || {
                        title: "",
                        picture: [],
                        price: "",
                        origin: ""
                    }, this.item_id = t.item_id || "", this.is_buy = t.is_buy || "", this.show_stock = "" === this.is_buy ? !0 : !1, !this.inited) {
                this.inited = !0, this.$el.append(m);
                var e = this.$(".layout-title");
                this.skuTitleView = new a({el: e}).render({
                    goods_info: this.goods_info,
                    activity: this.activity,
                    sku: this.sku
                }), this.$(".js-sku-views").empty();
                var r = this.$(".js-sku-views");
                if (this.skuSelectorView = new o({
                        sku: this.sku, goods_info: this.goods_info
                    }).render(), r.append(this.skuSelectorView.$el.children()), !this.isAddWish) {
                    var l = this.quantityLimit = this.getLimitNum(this.quota, this.quota_used, this.stockNum), d = $('<dl class="clearfix block-item"><dt class="model-title sku-num pull-left">                        <label>数量</label></dt><dd></dd></dl>');
                    this.quantityView = new i({
                        readonly: this.quantityReadOnly,
                        num: 1,
                        tagName: "dl",
                        className: "clearfix",
                        limitNum: +l.limitNum,
                        minimalNum: this.isAddWish ? 0 : 1,
                        onOverLimit: _(function (t) {
                            var e = this.quota_used > 0 ? "<br>您之前已经购买过" + this.quota_used + "件" : "";
                            return "quota" === l.limitType ? void motify.log("该商品每人限购" + this.quota + "件" + e) : "stock" === l.limitType ? void motify.log("就这么几件啦～") : void 0
                        }).bind(this),
                        onNumChange: _(function () {
                            var t;
                            return _(function (e) {
                                this.isAddWish && (0 === e ? t ? t.show() : (t = $('<div class="c-red text-right">0表示不限制赠送数量</div>'), this.quantityView.$el.parent().append(t)) : t.hide())
                            }).bind(this)
                        }).bind(this)()
                    }).render(), r.append(d), this.quantityView.$el.appendTo(d.find("dd")), this.show_stock && (this.stockView = new s({
                        el: $('<div class="stock pull-right font-size-12"></div>'),
                        hide_stock: this.sku.hide_stock
                    }).render({stock: this.stockNum}), this.quantityView.$el.append(this.stockView.$el))
                }
                this.messageView = new n({
                    messages: this.sku.messages,
                    className: "block-item block-item-messages"
                }), r.append(this.messageView.render().el), this.skuSelectorView.autoSelect()
            }
            if (this.$(".confirm-action").html(this.nActionBtnTemplate({
                    isMultiBtn: this.isMultiBtn,
                    isCartBtnHide: this.isCartBtnHide
                })), this.nConfirmBtn = 0 === this.$(".js-confirm-it").length ? this.$(".js-mutiBtn-confirm.confirm") : this.$(".js-confirm-it"), l && 0 === l.limitNum && this.nConfirmBtn.attr("disabled", !0), this.isMultiBtn)this.nConfirmBtn.data("text", "立即购买"); else {
                var c = this.isAddCart ? "加入购物车" : "下一步";
                this.nConfirmBtn.text(c), this.nConfirmBtn.data("text", c)
            }
            return this.$el.css(this.skuViewConfig), !this.isAddWish || this.sku.messages && 0 !== this.sku.messages.length || !this.sku.none_sku || r.hide(), this
        },
        events: {
            "click .js-confirm-it": "doConfirmClicked",
            "click .js-cancel": "onCancelClicked",
            "click .js-mutiBtn-confirm": "onMultiBtnClick"
        },
        onSelectChange: function (t) {
            var e = t.skuComb, i = t.skuThumb, n = this.stockNum;
            i && this.skuTitleView.changeSkuThumb(i), e ? (this.quantityView && (["19170526", "24413294", "24413268", "24413261"].indexOf(e.id) >= 0 && 54023 === +_global.kdt_id ? (this.quantityView && this.quantityView.setMinimalNum(10), this.quantityView && this.quantityView.updateNum(10), this.quantityView.updateBtnStatus()) : ["19170527", "24413295", "24413269", "24413262", "35907137"].indexOf(e.id) >= 0 && 54023 === +_global.kdt_id ? (this.quantityView && this.quantityView.setMinimalNum(50), this.quantityView && this.quantityView.updateNum(50), this.quantityView.updateBtnStatus()) : (this.quantityView && this.quantityView.setMinimalNum(1), this.quantityView && this.quantityView.updateNum(1), this.quantityView.updateBtnStatus()), ["35907136"].indexOf(e.id) >= 0 && 187661641 === parseInt(_global.goods_id, 10) && 54023 === +_global.kdt_id ? (this.quantityView && this.quantityView.updateNum(10), this.quantityView && this.quantityView.setMinimalNum(10), this.quantityView.updateBtnStatus()) : ["35907135"].indexOf(e.id) >= 0 && 187661641 === parseInt(_global.goods_id, 10) && 54023 === +_global.kdt_id && (this.quantityView && this.quantityView.updateNum(1), this.quantityView && this.quantityView.setMinimalNum(1), this.quantityView.updateBtnStatus())), n = parseInt(e.get("stock_num"), 10), this.stockView && this.stockView.setNum(n), this.setPrice(e.get("price"))) : (this.stockView && this.stockView.setNum(this.stockNum), this.skuTitleView.resetPrice()), this.quantityView && (this.quantityLimit = this.getLimitNum(this.quota, this.quota_used, n), e && ["35907136"].indexOf(e.id) >= 0 && 187661641 === parseInt(_global.goods_id, 10) && 54023 === +_global.kdt_id ? this.quantityView.setLimitNum(this.quantityLimit.limitNum >= 49 ? 49 : this.quantityLimit.limitNum) : e && ["35907135"].indexOf(e.id) >= 0 && 187661641 === parseInt(_global.goods_id, 10) && 54023 === +_global.kdt_id ? this.quantityView.setLimitNum(this.quantityLimit.limitNum >= 9 ? 9 : this.quantityLimit.limitNum) : this.quantityView.setLimitNum(this.quantityLimit.limitNum)), this.height(), this.$el.height(this.skuViewHeight)
        },
        setPrice: function (t) {
            this.isPriceCanChanged && this.skuTitleView.changePrice(t)
        },
        disablePriceChange: function () {
            this.isPriceCanChanged = !1
        },
        onMultiBtnClick: function (t) {
            t = t || window.event;
            var e = t.target || t.srcElement;
            this.isAddCart = $(e).hasClass("cart"), this.doConfirmClicked(t)
        },
        doConfirmClicked: function (t) {
            function e() {
                n.doSubmit({buyType: o})
            }

            var i = $(t.target);
            if (!i.attr("disabled")) {
                var n = this, o = this.getBuyType();
                t && window.Logger ? window.Logger && Logger.log({fm: "click", title: o}).then(e, function () {
                    motify.log("亲，请稍等。")
                }) : e()
            }
        },
        doSubmit: function () {
            var i, n = function (e) {
                var i = this, n = window._global.url.trade + "/wxpay/confirm?showwxpaytitle=1&kdt_id=" + this.kdt_id;
                e.from && (n = c.add(n, {from: e.from})), e.use_wxpay && (n = c.add(n, {use_wxpay: e.use_wxpay})), n = t(n);
                var o = this.messageView.getData();
                if (o) {
                    var s = $.extend({
                        goods_id: e.goods_id,
                        num: e.num,
                        sku_id: e.sku_id,
                        price: e.price
                    }, o), a = [s], r = {is_buy: this.is_buy, item_id: this.item_id};
                    delete e.goods_id, delete e.num, delete e.sku_id, delete e.price, e.order_from = "";
                    var l = {goodsList: JSON.stringify(a), common: JSON.stringify(e)};
                    r.item_id && (l.pinjian = JSON.stringify(r)), $._ajax({
                        url: "",
                        type: "POST",
                        dataType: "json",
                        data: l,
                        timeout: 15e3,
                        beforeSend: function () {
                            i.ajaxing = !0, i.nConfirmBtn.attr("disabled", "disabled"), i.nConfirmBtn.html("数据提交中")
                        },
                        success: function (t) {
                            var e = +t.code, o = t.data;
                            if (0 !== e)return motify.log(t.msg), void i.submitError("buy");
                            var s = c.add(n, {book_key: o});
                            i.onHide(), h(s)
                        },
                        error: function () {
                            motify.log("购买失败，请重试。"), i.submitError("buy")
                        },
                        complete: function () {
                            i.nConfirmBtn.removeAttr("disabled"), i.ajaxing = !1
                        }
                    })
                }
            }, o = function (t) {
                var i = this, n = this.baseUrl;
                $._ajax({
                    url: n + "/trade/cart/goods.jsonp",
                    type: "GET",
                    dataType: "jsonp",
                    cache: !1,
                    timeout: 15e3,
                    data: t,
                    beforeSend: function () {
                        i.ajaxing = !0
                    },
                    success: function (o) {
                        var s = +o.code;
                        if (0 === s)motify.log("已成功添加到购物车"), i.onAddSuccess({
                            wish: !1,
                            cart: !0,
                            buy: !1
                        }, t), window.eventHandler && (window.eventHandler.trigger("cart:add", o, t), window.eventHandler.trigger("global_icon:new")), e.doAction({action: "addToCart"}), i.onHide(); else if (40015 === s) {
                            var a = o.data || {}, r = n + "/trade/wxlogin", l = a.cart_key || "";
                            r = c.add(r, {cart_key: l, kdt_id: i.kdt_id, redirect_uri: location.href}), i.onHide(), h(r)
                        } else motify.log(o.msg)
                    },
                    error: function (t, e, n) {
                        i.ajaxing = !1, i.submitError("add-cart")
                    },
                    complete: function () {
                        i.ajaxing = !1
                    }
                })
            }, s = function (t) {
                var e = this;
                $._ajax({
                    url: "",
                    type: "POST",
                    dataType: "json",
                    cache: !1,
                    timeout: 15e3,
                    data: t,
                    beforeSend: function () {
                        e.ajaxing = !0, e.nConfirmBtn.html("提交中..."), e.doDisabled(e.nConfirmBtn, !0)
                    },
                    success: function (i) {
                        e.ajaxing = !1, e.submitSuccess(i, t)
                    },
                    error: function (t, i, n) {
                        e.ajaxing = !1, e.submitError("add-wish")
                    }
                })
            }, a = {"add-cart": o, buy: n, "add-wish": s, gift: n}, d = function (t, e) {
                (e.buyType || "function" == typeof i) && i.call(this, t)
            }, u = function () {
                var t, e, i = this.skuSelectorView.getSelectedSku(), n = this.messageView.getData();
                if (!i.status)return motify.log("请选择 " + i.errMsg), !1;
                if (t = i.sku, !n)return !1;
                if (e = this.quantityView ? this.quantityView.getNum() : 1, !e)return motify.log("亲，是不是数量不对？"), !1;
                var o = {
                    kdt_id: this.kdt_id,
                    goods_id: this.goods_id,
                    postage: this.postage || 0,
                    num: e,
                    activity_alias: this.activity_alias,
                    activity_id: this.activity_id,
                    activity_type: this.activity_type,
                    sku_id: t.id,
                    price: parseInt(this.skuTitleView.getPrice(), 10) || t.get("price")
                }, s = (c.get || function () {
                })("from");
                return s && s.length > 0 && (o.from = s), this.wxpay_env ? o.use_wxpay = 1 : o.use_wxpay = 0, _(o).extend(n), o
            };
            return function (t) {
                if (i = a[t.buyType], !t.notCheckBtnDisabled && this.isDisabled(this.nConfirmBtn))return !1;
                if (this.ajaxing)motify.log("提交订单中，请勿重复提交。"); else {
                    var e = u.call(this);
                    if (!e)return !1;
                    if (this.isGift && (e.order_type = 1), t.accept_price && (e.accept_price = t.accept_price), this.needLogin()) {
                        var n = new l({
                            contentViewClass: r, contentViewOptions: {
                                afterLogin: _(function (i) {
                                    n.hide(), window.user_logined = !0, "pinjian" == window._global.goods_type ? window.location.reload() : d.call(this, e, t)
                                }).bind(this)
                            }
                        });
                        return void n.render().show()
                    }
                    d.call(this, e, t)
                }
            }
        }(),
        doWait: function (t) {
            t > 0 ? (this.nConfirmBtn.attr("disabled", !0), this.isMultiBtn ? this.nConfirmBtn.text(this.nConfirmBtn.data("text") + "(" + t + ")") : this.nConfirmBtn.text("正在排队购买，请等待 " + t + " 秒后再提交"), this.waitId = setTimeout(_(this.doWait).bind(this, t - 1), 1e3)) : (this.nConfirmBtn.removeAttr("disabled"), this.nConfirmBtn.text(this.nConfirmBtn.data("text")), this.waitId = !1)
        },
        submitSuccess: function () {
            var t = {11011: !0, 11014: !0, 11012: !0, 11013: !0}, e = function (t) {
                motify.log(t), this.nConfirmBtn.html(t), this.doDisabled(this.nConfirmBtn, !0)
            };
            return function (i, n) {
                var o = this, s = i.code;
                if (0 === s) {
                    if (o.onAddSuccess({
                            wish: o.isAddWish,
                            cart: !1,
                            buy: !o.isAddWish
                        }, n), o.isAddWish)return window.eventHandler && window.eventHandler.trigger("wish:add"), window.eventHandler && window.eventHandler.trigger("global_icon:new"), void o.onHide();
                    var a = i.data.order_no;
                    if (!a || 0 == a.length || !i.data.trade_confirm_url)return motify.log("订单生成失败，请联系管理员。"), o.nConfirmBtn.html("确认提交"), o.nConfirmBtn.removeAttr("disabled"), !1;
                    h(i.data.trade_confirm_url)
                } else 12500 === s ? (this.isMultiBtn && motify.log("网络繁忙，请稍后再试～"), o.doWait(+i.data.wait)) : 11010 === s ? Utils.needConfirm(i.msg + "（新价格：" + (parseInt(i.data.cur_price, 10) / 100).toFixed(2) + "元）", function () {
                    var t = o.getBuyType();
                    o.doSubmit({buyType: t, accept_price: 1, notCheckBtnDisabled: !0})
                }, function () {
                    window.location.reload()
                }) : 13021 === s ? h(i.data.redirectUrl) : t[s + ""] ? e.call(o, i.msg) : 11020 === s ? (motify.log(i.msg + "正在刷新页面..."), window.location.reload()) : 11021 === s ? (motify.log(i.msg), o.nConfirmBtn.html("确认提交"), o.nConfirmBtn.removeAttr("disabled"), o.quantityView.updateNum(1)) : (motify.log(i.msg), o.nConfirmBtn.html("再次提交"), o.nConfirmBtn.removeAttr("disabled"))
            }
        }(),
        submitError: function (t) {
            this.doDisabled(this.nConfirmBtn, !1), "buy" == t ? this.nConfirmBtn.html("立即购买") : "add-cart" == t ? (motify.log("添加到购物车失败"), this.nConfirmBtn.html("加入购物车")) : "add-wish" == t && (motify.log("添加到心愿单失败"), this.nConfirmBtn.html("下一步"))
        },
        onCancelClicked: function (t) {
            this.onHide()
        },
        hide: function (t) {
            this.waitId && (clearTimeout(this.waitId), this.waitId = !1, this.nConfirmBtn.removeAttr("disabled")), this.isMultiBtn && (this.$(".js-sku-views").empty(), this.$(".layout-content").height("auto"), this.skuSelectorView = this.skuSelectorView.clear())
        },
        height: function () {
            var t = $(window).height() - this.viewTop, e = this.$(".layout-title").outerHeight(), i = t - e, n = this.$(".layout-content").height();
            return this.skuConH = n, this.skuConWinH = i, this.skuConHeight = i > n ? n : i, this.skuViewHeight = this.skuConHeight + e, this.$(".layout-content").css("max-height", i), this.skuViewHeight
        },
        onAfterPopupShow: function () {
            this.quantityView && this.quantityView.validateNum()
        },
        displaySku: function (t) {
            return this.render(t || {})
        },
        getLimitNum: function (t, e, i) {
            var n, o, s = t - e;
            return i > s && 0 !== t ? (n = +s, o = "quota") : (n = +i, o = "stock"), {limitNum: n, limitType: o}
        },
        doDisabled: function (t, e) {
            e ? this.nConfirmBtn.attr("disabled", !0) : this.nConfirmBtn.removeAttr("disabled")
        },
        isDisabled: function (t) {
            return t.attr("disabled")
        },
        getBuyType: function () {
            return this.isAddWish ? "add-wish" : this.isAddCart ? "add-cart" : this.isGift ? "gift" : "buy"
        },
        needLogin: function () {
            return window.user_logined || !this.need_ajax_login ? !1 : this.isAddWish || this.isAddCart ? !1 : !0
        }
    });
    return window.BuyView = g
}), define("main", function () {
}), function (t) {
    var e = document, i = "appendChild", n = "styleSheet", o = e.createElement("style");
    o.type = "text/css", e.getElementsByTagName("head")[0][i](o), o[n] ? o[n].cssText = t : o[i](e.createTextNode(t))
}("@charset \"UTF-8\";.block,.block-item,.name-card .detail a{display:block}.quantity,.quantity .txt,.quantity button,.sku-layout .vertical-middle{vertical-align:middle}.block,.block p,.block-item{overflow:hidden}.block,.block-item,.sku-layout .block-item,.sku-layout .layout-title{border-images:url(images/border-line.png) 2 stretch}.goods-header,.images-input-trigger,.quantity .txt{-webkit-tap-highlight-color:transparent}.block-item{position:relative;padding:10px;line-height:22px;border:0;-webkit-border-images:url(images/border-line.png) 2 stretch;-moz-border-images:url(images/border-line.png) 2 stretch;border-top:2px solid #e5e5e5}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.block-item{border-top-width:1px}}.block-item .btn-auth-code{position:absolute;top:6px;right:0;height:30px;line-height:30px;padding-left:7px;padding-right:7px;font-weight:700}.block-item .verify-images{position:absolute;width:80px;height:30px;right:10px;top:7px}.block-item.border-none{border-bottom:0 none}.block-item ul{padding-right:50px}.block-item ul em{color:#999}.block-item h4.block-item-title{line-height:22px;float:left;margin-right:10px}.block{-webkit-border-images:url(images/border-line.png) 2 stretch;-moz-border-images:url(images/border-line.png) 2 stretch;border-top:2px solid #e5e5e5;border-bottom:2px solid #e5e5e5;margin:10px 0;background-color:#fff;position:relative;font-size:14px}.block.top-0,.block:first-child{margin-top:0}.quantity,.tag{display:inline-block}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.block{border-top-width:1px;border-bottom-width:1px}}.block-list>.block-item:first-child,.block.border-0,.block.border-top-0{border-top:0 none}.block.border-0,.block.border-bottom-0{border-bottom:0 none}.block.bottom-0{margin-bottom:0}.block .bottom{padding:10px;height:18px;line-height:18px}.block .bottom .price{float:right;color:#f60}.block .opt-wrapper{position:absolute;top:9px;right:5px}.block .opt-wrapper .btn,.block .opt-wrapper .opt-link{margin-right:5px}.block .opt-link{color:#09f;font-size:12px;line-height:24px}.sku-layout .layout-title .goods-base-info .goods-price .old-price,.sku-layout .layout-title .goods-base-info .goods-price .original-price,.tag{color:#999}.block.block-list{margin:0;padding:0 0 0 10px;list-style:none;font-size:14px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.block.block-list.margin-top-normal{margin-top:20px}.block-list.wf{padding-left:0}.block-list.wf .b-list{padding-left:10px;background-color:#fff}.block-list>.block-item{padding:10px 10px 10px 0}.block.block-list+.block.block-list{margin-top:12px}.quantity .txt,.quantity button,.tag{margin:0;text-align:center}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min-device-pixel-ratio:1.5){.block.block-list li span.clear{background:url(images/icon_clear.png) center center no-repeat;background-size:100%}}.tag{background-color:transparent;border:1px solid #e5e5e5;border-radius:3px;font-size:12px;line-height:12px;padding:4px}.tag-big{font-size:14px;line-height:18px}.tag.tag-green{color:#06bf04;border-color:#0c3}.tag.tag-orange,.tag.tag-orangef60{color:#f60;border-color:#f60}.tag.tag-white{color:#333;border-color:#e5e5e5}.tag.tag-blue{color:#00a0f8;border-color:#00a0f8}.tag.tag-red{color:#ed5050;border-color:#ed5050}.tag.tag-pink{color:#ee614b;border-color:#ee614b}.tag.disabled{background-color:#ddd!important;background-images:none!important;border:1px solid transparent!important;color:#fff!important}.quantity{font-size:0;position:relative}.quantity input[type=number]::-webkit-outer-spin-button{margin:0}.quantity button{border:2px solid #eee;font-size:16px;line-height:10px;font-weight:700;color:#666;padding:5px;outline:0!important;width:26px;height:30px;text-indent:-9999px;overflow:hidden}.quantity .txt{font-size:14px;width:24px;height:18px;border-radius:0}.quantity .minus::before,.quantity .plus::before{width:8px;height:2px;top:0;left:0;right:0;margin:auto;background-color:#6c6c6c;bottom:0;content:''}.quantity .txt:focus{border-color:#eee}.quantity .minus{position:relative;border-radius:4px 0 0 4px;border-right:0 none}.quantity .minus::before{position:absolute}.quantity .plus{position:relative;border-left:0 none;border-radius:0 4px 4px 0}.quantity .plus::before{position:absolute}.quantity .plus::after{position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;content:'';width:2px;height:8px;background-color:#6c6c6c}.quantity .minus.disabled::before,.quantity .plus.disabled::after,.quantity .plus.disabled::before{background-color:#ddd}.quantity .response-area{width:42px;height:42px;top:-7px;position:absolute}.name-card,.name-card .thumb{position:relative;overflow:hidden}.quantity .response-area-plus{right:-5px}.quantity .response-area-minus{left:-5px}.name-card{margin-left:0;width:auto;padding:5px 0}.name-card .thumb{width:60px;height:60px;float:left;margin-left:auto;margin-right:auto;background-size:cover}.name-card .thumb img{position:absolute;margin:auto;top:0;left:0;right:0;bottom:0;width:auto;height:auto;max-width:100%;max-height:100%}.name-card a:active,.name-card a:hover{text-decoration:none}.name-card .detail{margin-left:68px;width:auto;position:relative}.name-card .detail h3{margin-top:1px;color:#333;font-size:12px;line-height:16px;width:100%}.name-card .detail p{position:relative;font-size:12px;line-height:16px;white-space:nowrap;margin:0 0 2px;color:#ccc}.name-card .detail .l2-ellipsis{max-height:34px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.name-card .btn-goods-link{bottom:8px;right:10px;position:absolute;line-height:14px;font-size:12px}.name-card.name-card-3col{padding:8px 85px 8px 0}.name-card.name-card-3col .right-col{position:absolute;right:0;top:8px;width:78px;padding-right:10px;font-size:12px}.name-card.name-card-3col .right-col .price{font-size:14px;color:#515151;text-align:right;line-height:16px}.name-card.name-card-3col .right-col .num{font-weight:200;text-align:right;margin-top:3px;padding:0;color:#555}.name-card.name-card-3col .right-col .num .num-txt{padding:0;line-height:22px;color:#515151}.name-card.name-card-3col .right-col .order-state{font-size:13px;text-align:right}.sku-tag.tag{color:#000;border-color:#999}.sku-tag.tag-orangef60{color:#f60;border-color:#f60}.sku-layout{-webkit-overflow-scrolling:touch;background-color:#fff}.sku-layout .line-through{display:inline-block;text-decoration:line-through;line-height:23px}.goods-header,.goods-header.restore .thumb{display:block}.sku-layout .block-item{border:0;-webkit-border-images:url(images/border-line.png) 2 stretch;-moz-border-images:url(images/border-line.png) 2 stretch;border-top:2px solid #e5e5e5}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.sku-layout .block-item{border-top-width:1px}}.sku-layout .block-item:first-child{border-top:0 none}.name-card.sku-name-card .thumb{width:40px;height:40px;margin:2px 0 0 10px}.name-card.sku-name-card .thumb img{height:40px}.name-card.sku-name-card .detail{margin-left:55px}.tag.tag-redf30{color:#f30;border-color:#f30}.goods-header{height:auto;padding:8px 0 6px;overflow:hidden;border-top:1px solid #f2f2f2;background-color:#fff}.goods-header.restore{border-top-color:transparent;background-color:#fff}.goods-header.restore .title{padding-right:5px}.goods-header .thumb{display:none;width:50px;height:50px;border:1px solid #eee;float:left;margin:2px 0 0 10px}.goods-header .thumb>img{max-width:100%;max-height:100%}.goods-header .title{font-weight:400;margin:0;padding:0 10px;font-size:16px;line-height:22px;text-align:left}.goods-header .wish-add{position:relative;margin-top:-1px;margin-right:11px;padding-left:26px;height:15px;line-height:16px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.goods-header .wish-add:before{content:'';position:absolute;left:4px;width:19px;height:16px;background:url(images/wap/showcase/goods/goods_c9431a6d41.png) 0 -15px no-repeat;background-size:58px 48px}.goods-header .wish-added{background-color:#f30;color:#fff}.goods-header .wish-added:before{background-position:0 0}.wish-add-drop{width:14px;height:12px;background-images:url(images/wap/wish/share_like@2x.png);background-size:cover;z-index:1000}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.goods-header .wish-add:before{background-images:url(images/goods.png)}}.sku-layout .model-title{padding-top:3px;font-size:13px}.sku-layout .model-list{zoom:1;padding-left:0;margin-bottom:0}.sku-layout .model-list:after{content:\"\";display:table;clear:both}.sku-layout .model-list li{position:relative;margin-right:10px;min-width:32px;max-width:180px;line-height:16px;padding:6px 9px;margin-bottom:10px}.sku-layout .model-list li.active::after{content:' ';position:absolute;bottom:-1px;right:-1px;background:url(images/showcase.png) 0 -108px no-repeat;height:12px;width:12px}.sku-layout .model-list li.unavailable{border-color:#eee;color:#eee;cursor:not-allowed}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.sku-layout .model-list li.active::after{background-images:url(images/showcase.png);background-position:0 -135px;background-size:40px auto}}.sku-layout .layout-content .goods-models>dl{padding:7px 0 4px}.sku-layout .layout-content .goods-models>dl .sku-num{width:15%;line-height:42px}.sku-layout .layout-content .goods-models>dl .stock{line-height:42px;padding-right:7px}.sku-layout .layout-content .goods-models>dl .stock .stock-num{padding-left:3px;line-height:48px;float:left}.sku-layout .quantity{float:right;margin-top:10px}.sku-layout .quantity .minus{border-radius:2px 0 0 2px}.sku-layout .quantity .plus{border-radius:0 2px 2px 0}.sku-layout .quantity .txt{width:33px;height:25px;padding:1px;border:1px solid #999;border-width:1px 0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sku-layout .quantity .txtCover{position:absolute;top:0;left:37px;bottom:0;right:37px}.sku-layout .quantity .minus,.sku-layout .quantity .plus{width:37px;height:29px;background-color:#fff;border:1px solid #999}sup.required{color:red!important}.block-list .block-item.block-item-messages{padding:0;-webkit-tap-highlight-color:transparent}.sku-message{padding-top:10px}.sku-message dl{border:1px solid #c9c9c9;border-radius:2px;margin-bottom:10px}.sku-message dt{width:70px;padding:0 10px;position:relative}.sku-message dt .required{font-size:17px;margin-left:-7px;position:absolute}.sku-message dt label{height:40px;line-height:40px}.sku-message .comment-wrapper{margin-left:90px;padding-right:5px;position:relative}.sku-message .comment-wrapper .txt,.sku-message .comment-wrapper .txta{display:inline-block;padding:5px;resize:none;border-radius:4px;width:94%;border:0;margin-top:7px;-webkit-appearance:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sku-message .comment-wrapper .txt:focus,.sku-message .comment-wrapper .txta:focus{outline:0!important;border-color:#666}.sku-message .comment-wrapper .txtCover{top:0;left:0;right:0;bottom:0;position:absolute}.images-input-trigger{padding-left:40px;padding-right:10px;height:35px;line-height:26px;margin-top:12.5px;margin-bottom:12.5px;background-images:url(images/camera.png);background-repeat:no-repeat;background-size:15px 14px;background-position:15px 49%}.images-input-show{display:block;padding-top:5px;margin-right:137px}.images-input-show img{margin:0 auto;display:block}.photo-input{position:absolute;opacity:0;height:60px;width:143px;right:0;top:0}.sku-layout .layout-title{-webkit-border-images:url(images/border-line.png) 2 stretch;-moz-border-images:url(images/border-line.png) 2 stretch;border-bottom:2px solid #e5e5e5;border-top-width:0;position:static;padding:8px 0 6px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.sku-layout .layout-title{border-bottom-width:1px}}.sku-layout .layout-title .goods-base-info .title{padding-right:45px;line-height:22px}.sku-layout .layout-title .goods-base-info .goods-price{padding:0 55px 0 0}.sku-layout .layout-title .goods-base-info .goods-price .current-price{line-height:20px}.sku-layout .layout-title .goods-base-info .goods-price .current-price .price-name{padding-top:1px}.sku-layout .layout-title .goods-base-info .goods-price .current-price .price-tag{line-height:20px;margin:0 2px}.sku-layout .layout-title .goods-base-info .goods-price .original-price{display:none}.sku-layout .layout-content{overflow-y:scroll;border:1px solid #fff;line-height:20px;background-color:#fff}.sku-layout .layout-content .goods-models{padding:1px 10px}.sku-layout .layout-content .content-foot{padding:10px;font-size:0}.sku-layout .layout-content .content-foot .half-button{margin: auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:50%}.sku-layout .layout-content .content-foot .half-button:first-child{padding-right:5px}.sku-layout .layout-content .content-foot .half-button:last-child{padding-left:5px}.sku-layout .sku-cancel{position:absolute;right:3px;top:2px;padding:10px}.sku-layout .sku-cancel .cancel-img{height:27px;width:27px;background-images:url(images/showcase.png);background-position:0 -120px;background-repeat:no-repeat}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.sku-layout .sku-cancel .cancel-img{background-images:url(images/showcase.png);background-position:0 -108px;background-size:40px auto}}.sku-box-shadow{-webkit-box-shadow:0 -1px 14px rgba(0,0,0,.9);box-shadow:0 -1px 14px rgba(0,0,0,.9)}");